From 2520c4b2c81cf8fe9b591383f95eadfefb9eff75 Mon Sep 17 00:00:00 2001 From: jenkins Date: Thu, 1 Jan 2026 14:27:33 +0000 Subject: [PATCH 01/34] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- springdoc-openapi-bom/pom.xml | 2 +- springdoc-openapi-starter-common/pom.xml | 2 +- springdoc-openapi-starter-webflux-api/pom.xml | 2 +- springdoc-openapi-starter-webflux-scalar/pom.xml | 2 +- springdoc-openapi-starter-webflux-ui/pom.xml | 2 +- springdoc-openapi-starter-webmvc-api/pom.xml | 2 +- springdoc-openapi-starter-webmvc-scalar/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 +- 21 files changed, 22 insertions(+), 22 deletions(-) diff --git a/pom.xml b/pom.xml index aee0063f5b..189192896e 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 org.springdoc springdoc-openapi - 3.0.1 + 3.0.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 - v3.0.1 + HEAD diff --git a/springdoc-openapi-bom/pom.xml b/springdoc-openapi-bom/pom.xml index 25239f1045..9655386962 100644 --- a/springdoc-openapi-bom/pom.xml +++ b/springdoc-openapi-bom/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 3.0.1 + 3.0.2-SNAPSHOT springdoc-openapi-bom ${project.artifactId} diff --git a/springdoc-openapi-starter-common/pom.xml b/springdoc-openapi-starter-common/pom.xml index 65ee65a23e..a751ee18f6 100644 --- a/springdoc-openapi-starter-common/pom.xml +++ b/springdoc-openapi-starter-common/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 3.0.1 + 3.0.2-SNAPSHOT springdoc-openapi-starter-common ${project.artifactId} diff --git a/springdoc-openapi-starter-webflux-api/pom.xml b/springdoc-openapi-starter-webflux-api/pom.xml index c2f7be5867..5b63cffd4b 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 - 3.0.1 + 3.0.2-SNAPSHOT springdoc-openapi-starter-webflux-api ${project.artifactId} diff --git a/springdoc-openapi-starter-webflux-scalar/pom.xml b/springdoc-openapi-starter-webflux-scalar/pom.xml index 21bbb60a67..d538d733ea 100644 --- a/springdoc-openapi-starter-webflux-scalar/pom.xml +++ b/springdoc-openapi-starter-webflux-scalar/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 3.0.1 + 3.0.2-SNAPSHOT springdoc-openapi-starter-webflux-scalar ${project.artifactId} diff --git a/springdoc-openapi-starter-webflux-ui/pom.xml b/springdoc-openapi-starter-webflux-ui/pom.xml index f2173b1549..2abb961f80 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 - 3.0.1 + 3.0.2-SNAPSHOT springdoc-openapi-starter-webflux-ui ${project.artifactId} diff --git a/springdoc-openapi-starter-webmvc-api/pom.xml b/springdoc-openapi-starter-webmvc-api/pom.xml index 958f77ca0c..0e6fb582db 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 - 3.0.1 + 3.0.2-SNAPSHOT springdoc-openapi-starter-webmvc-api ${project.artifactId} diff --git a/springdoc-openapi-starter-webmvc-scalar/pom.xml b/springdoc-openapi-starter-webmvc-scalar/pom.xml index a739243f39..8ee6973788 100644 --- a/springdoc-openapi-starter-webmvc-scalar/pom.xml +++ b/springdoc-openapi-starter-webmvc-scalar/pom.xml @@ -3,7 +3,7 @@ org.springdoc springdoc-openapi - 3.0.1 + 3.0.2-SNAPSHOT springdoc-openapi-starter-webmvc-scalar ${project.artifactId} diff --git a/springdoc-openapi-starter-webmvc-ui/pom.xml b/springdoc-openapi-starter-webmvc-ui/pom.xml index a31afa9c2f..af790c83b2 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 - 3.0.1 + 3.0.2-SNAPSHOT springdoc-openapi-starter-webmvc-ui ${project.artifactId} diff --git a/springdoc-openapi-tests/pom.xml b/springdoc-openapi-tests/pom.xml index aa9b55f1cd..7d01232834 100644 --- a/springdoc-openapi-tests/pom.xml +++ b/springdoc-openapi-tests/pom.xml @@ -2,7 +2,7 @@ springdoc-openapi org.springdoc - 3.0.1 + 3.0.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 c58111bebe..bd9bc7122b 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 - 3.0.1 + 3.0.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 275428a97d..00add5ae60 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 - 3.0.1 + 3.0.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 0cad01b696..b98adf605d 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 - 3.0.1 + 3.0.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 ca8e318778..e8569c600f 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 - 3.0.1 + 3.0.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 4b35434024..b2091c75a0 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 - 3.0.1 + 3.0.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 2b79b2765a..6c50cd3bf6 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 - 3.0.1 + 3.0.2-SNAPSHOT springdoc-openapi-groovy-tests ${project.artifactId} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/pom.xml index c9113d06cb..942871a8cd 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 - 3.0.1 + 3.0.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 44c4d4f770..bc56b2fa14 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 - 3.0.1 + 3.0.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 5b6d7e5b89..b55693873c 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 - 3.0.1 + 3.0.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 9b839f3078..0a07f184ae 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 - 3.0.1 + 3.0.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 697e915bd1..b477e20356 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 - 3.0.1 + 3.0.2-SNAPSHOT springdoc-openapi-security-tests ${project.artifactId} From 231305069875c9bc8dd0927119ca6c7f83be41a0 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Tue, 10 Feb 2026 16:20:50 +0100 Subject: [PATCH 02/34] Upgrade swagger-core from version 2.2.41 to 2.2.42. Fixes #3206 --- pom.xml | 2 +- .../test/resources/results/3.0.1/app102.json | 1 + .../test/resources/results/3.1.0/app102.json | 3 +- .../test/resources/results/3.0.1/app102.json | 3 +- .../resources/results/3.0.1/app105-4.json | 1 + .../test/resources/results/3.0.1/app121.json | 1 + .../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 | 4 + .../test/resources/results/3.0.1/app19.json | 1 + .../test/resources/results/3.0.1/app209.json | 4 + .../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 + .../test/resources/results/3.0.1/app24.json | 1 + .../test/resources/results/3.0.1/app77.json | 2 + .../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 | 3 +- .../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 | 12 ++- .../test/resources/results/3.1.0/app19.json | 3 +- .../test/resources/results/3.1.0/app209.json | 12 ++- .../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 | 4 +- .../test/resources/results/3.1.0/app24.json | 3 +- .../test/resources/results/3.1.0/app77.json | 6 +- .../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 | 2 + .../test/resources/results/3.1.0/app18.json | 6 +- .../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 | 57 +++++++------- .../test/resources/results/3.0.1/app14.json | 1 + .../test/resources/results/3.0.1/app18.json | 4 + .../test/resources/results/3.0.1/app19.json | 1 + .../test/resources/results/3.0.1/app21.json | 1 + .../test/resources/results/3.0.1/app23.json | 1 + .../test/resources/results/3.0.1/app24.json | 1 + .../test/resources/results/3.0.1/app77.json | 2 + .../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 | 59 +++++++------- .../test/resources/results/3.1.0/app14.json | 47 +++++------ .../test/resources/results/3.1.0/app18.json | 78 ++++++++++--------- .../test/resources/results/3.1.0/app19.json | 29 +++---- .../test/resources/results/3.1.0/app21.json | 7 +- .../test/resources/results/3.1.0/app23.json | 3 +- .../test/resources/results/3.1.0/app24.json | 11 +-- .../test/resources/results/3.1.0/app77.json | 6 +- 60 files changed, 258 insertions(+), 176 deletions(-) diff --git a/pom.xml b/pom.xml index 189192896e..2b15bc54cc 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ 0.7.0 1.5.0 - 2.2.41 + 2.2.42 5.31.0 1.13.1 0.9.1 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 d7479b41b8..e77bbf251d 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.1.0/app102.json b/springdoc-openapi-starter-webflux-api/src/test/resources/results/3.1.0/app102.json index f43ac61336..2a6c70e576 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-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 0f17e72f0a..8310b737cf 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" } }, @@ -132,4 +133,4 @@ } } } -} +} \ No newline at end of file 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 76d34675f1..9fe3e74aea 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 0520da018d..2390ac67c4 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" } }, 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 9bd24ef37d..235e0fe829 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 90ea79632f..978d6dd120 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 d65b8eca26..7e6decf59c 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 d10b56632e..4c7e59f548 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 c1c84699ab..66a05b228a 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 @@ -23,6 +23,7 @@ "in": "query", "required": true, "schema": { + "minLength": 1, "type": "string" } } @@ -54,6 +55,7 @@ "description": "persons name", "required": true, "schema": { + "minLength": 1, "type": "string" } } @@ -149,6 +151,7 @@ "description": "persons name", "required": true, "schema": { + "minLength": 1, "type": "string" } } @@ -180,6 +183,7 @@ "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 5de6c880aa..5cbef60a54 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 @@ -52,6 +52,7 @@ "content": { "application/json": { "schema": { + "minLength": 1, "type": "string" } } 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 c1c84699ab..66a05b228a 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 @@ -23,6 +23,7 @@ "in": "query", "required": true, "schema": { + "minLength": 1, "type": "string" } } @@ -54,6 +55,7 @@ "description": "persons name", "required": true, "schema": { + "minLength": 1, "type": "string" } } @@ -149,6 +151,7 @@ "description": "persons name", "required": true, "schema": { + "minLength": 1, "type": "string" } } @@ -180,6 +183,7 @@ "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/app21.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app21.json index 2d53bffbf1..db5cde3abb 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 22902fadc9..4cb10bb742 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 d65b8eca26..7e6decf59c 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 d10b56632e..4c7e59f548 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/app24.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app24.json index 885b7d4573..181e3bf011 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.0.1/app77.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app77.json index c08bdf0d57..d2f2f207d3 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app77.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app77.json @@ -23,6 +23,7 @@ "in": "query", "required": true, "schema": { + "minLength": 1, "type": "string" } } @@ -54,6 +55,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 35eeb5ea9f..ed29774ae7 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 f393a51547..ccf0baf41f 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 3a9f3652b7..c184ff2da0 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 } }, { 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 e2bb2165df..141b2f485c 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 1475f7c03b..37ced6f3ab 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,4 +64,3 @@ }, "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 e326399502..e36a4f0f63 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 4b4c1bfb09..222aa15481 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,4 +64,3 @@ }, "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 0142d8173e..8cb518c8f1 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 @@ -23,7 +23,8 @@ "in": "query", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } ], @@ -54,7 +55,8 @@ "description": "persons name", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } ], @@ -149,7 +151,8 @@ "description": "persons name", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } ], @@ -180,7 +183,8 @@ "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 b27e184d4f..b65e5fa76f 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 @@ -52,7 +52,8 @@ "content": { "application/json": { "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } }, 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 0142d8173e..8cb518c8f1 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 @@ -23,7 +23,8 @@ "in": "query", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } ], @@ -54,7 +55,8 @@ "description": "persons name", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } ], @@ -149,7 +151,8 @@ "description": "persons name", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } ], @@ -180,7 +183,8 @@ "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 136b34d947..75fb1e6176 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 25d752698a..7f16dc76ee 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 e326399502..e36a4f0f63 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 37e48614e1..222aa15481 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 e326399502..7a3f3f77e7 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 } } ], @@ -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/app24.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app24.json index fd8082586a..5ca1729ba7 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-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 d46b360c6a..826bcaebf7 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 @@ -23,7 +23,8 @@ "in": "query", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } ], @@ -54,7 +55,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 76d34675f1..9fe3e74aea 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 f393a51547..ccf0baf41f 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 54719949c7..d46aa228b7 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" 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 e730d5a606..073f17c404 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" }, 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 83c8687eaf..c308be4cbf 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" } }, 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 e249a3bf6d..9b586f2bb9 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,6 +38,7 @@ "description": "the name", "required": true, "schema": { + "minLength": 1, "type": "string" } } 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 2d95f9194d..718d7d3064 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,16 +149,38 @@ }, "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": { - "childParam": { - "minLength": 1, + "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." }, "intParam": { "type": "integer", @@ -182,35 +205,13 @@ "$ref": "#/components/schemas/Nested" } }, - "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" } }, "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 461f084a71..433ad8c2c6 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" } } 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 949fa4cc45..2090e8a395 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" } } @@ -65,6 +66,7 @@ "description": "persons name", "required": true, "schema": { + "minLength": 1, "type": "string" } } @@ -98,6 +100,7 @@ "description": "persons name", "required": true, "schema": { + "minLength": 1, "type": "string" } } @@ -201,6 +204,7 @@ "description": "persons name", "required": true, "schema": { + "minLength": 1, "type": "string" } } 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 5b0a90b8b7..dd2dc29cde 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 @@ -94,6 +94,7 @@ "content": { "application/json": { "schema": { + "minLength": 1, "type": "string" } } 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 dffb377e5f..2a345c7985 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" } } 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 1637d7918a..5da3d64e89 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" } } 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 7595a7bd82..aa71958555 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" } } diff --git a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app77.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app77.json index bbc88d7b00..cacab4e308 100644 --- a/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app77.json +++ b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.0.1/app77.json @@ -32,6 +32,7 @@ "description": "the name", "required": true, "schema": { + "minLength": 1, "type": "string" } } @@ -66,6 +67,7 @@ "description": "the name", "required": true, "schema": { + "minLength": 1, "type": "string" } } 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 32abd9ef41..debffb3edb 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 } }, { 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 deb8b48689..437cc19b90 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,7 +38,8 @@ "description": "the name", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } ], 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 be1267d354..2cbedad650 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 } }, { @@ -148,14 +149,36 @@ }, "components": { "schemas": { + "Nested": { + "type": "object", + "description": "The type Nested.", + "properties": { + "param1": { + "type": "string", + "description": "The Param 1." + }, + "param2": { + "type": "integer", + "description": "The Param 2." + } + } + }, "InheritedRequestParams": { "type": "object", "description": "The type Inherited request params.", "properties": { - "childParam": { + "stringParam": { "type": "string", - "description": "parameter from child of RequestParams", - "minLength": 1 + "description": "The String param." + }, + "stringParam1": { + "type": "string", + "deprecated": true, + "description": "The String param 1." + }, + "stringParam2": { + "type": "string", + "description": "The String param 2." }, "intParam": { "type": "integer", @@ -181,37 +204,15 @@ "$ref": "#/components/schemas/Nested" } }, - "stringParam": { - "type": "string", - "description": "The String param." - }, - "stringParam1": { - "type": "string", - "deprecated": true, - "description": "The String param 1." - }, - "stringParam2": { + "childParam": { "type": "string", - "description": "The String param 2." + "description": "parameter from child of RequestParams", + "minLength": 1 } }, "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/app14.json b/springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results/3.1.0/app14.json index ff15a730d4..86a19a41bc 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,6 +17,28 @@ } ], "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": [ @@ -32,7 +54,8 @@ "description": "the name", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } ], @@ -42,28 +65,6 @@ } } } - }, - "/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": {} 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 a6b3550910..3fcc325b60 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,22 +51,24 @@ } } }, - "/persons2": { + "/persons7": { "get": { "tags": [ "hello-controller" ], - "summary": "Persons 2 string.", - "description": "Persons 2 string.", - "operationId": "persons2", + "summary": "Persons 7 string.", + "description": "Persons 7 string.", + "operationId": "persons7", "parameters": [ { - "name": "name", + "name": "age", "in": "query", - "description": "persons name", + "description": "the age", "required": true, "schema": { - "type": "string" + "type": "integer", + "format": "int32", + "exclusiveMinimum": 0 } } ], @@ -83,14 +86,14 @@ } } }, - "/persons3": { + "/persons6": { "get": { "tags": [ "hello-controller" ], - "summary": "Persons 3 string.", - "description": "Persons 3 string.", - "operationId": "persons3", + "summary": "Persons 6 string.", + "description": "Persons 6 string.", + "operationId": "persons6", "parameters": [ { "name": "name", @@ -98,7 +101,8 @@ "description": "persons name", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } ], @@ -116,14 +120,14 @@ } } }, - "/persons4": { + "/persons5": { "get": { "tags": [ "hello-controller" ], - "summary": "Persons 4 string.", - "description": "Persons 4 string.", - "operationId": "persons4", + "summary": "Persons 5 string.", + "description": "Persons 5 string.", + "operationId": "persons5", "parameters": [ { "name": "age", @@ -133,7 +137,7 @@ "schema": { "type": "integer", "format": "int32", - "minimum": 0 + "maximum": 0 } } ], @@ -151,14 +155,14 @@ } } }, - "/persons5": { + "/persons4": { "get": { "tags": [ "hello-controller" ], - "summary": "Persons 5 string.", - "description": "Persons 5 string.", - "operationId": "persons5", + "summary": "Persons 4 string.", + "description": "Persons 4 string.", + "operationId": "persons4", "parameters": [ { "name": "age", @@ -168,7 +172,7 @@ "schema": { "type": "integer", "format": "int32", - "maximum": 0 + "minimum": 0 } } ], @@ -186,14 +190,14 @@ } } }, - "/persons6": { + "/persons3": { "get": { "tags": [ "hello-controller" ], - "summary": "Persons 6 string.", - "description": "Persons 6 string.", - "operationId": "persons6", + "summary": "Persons 3 string.", + "description": "Persons 3 string.", + "operationId": "persons3", "parameters": [ { "name": "name", @@ -201,7 +205,8 @@ "description": "persons name", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } ], @@ -219,24 +224,23 @@ } } }, - "/persons7": { + "/persons2": { "get": { "tags": [ "hello-controller" ], - "summary": "Persons 7 string.", - "description": "Persons 7 string.", - "operationId": "persons7", + "summary": "Persons 2 string.", + "description": "Persons 2 string.", + "operationId": "persons2", "parameters": [ { - "name": "age", + "name": "name", "in": "query", - "description": "the age", + "description": "persons name", "required": true, "schema": { - "type": "integer", - "format": "int32", - "exclusiveMinimum": 0 + "type": "string", + "minLength": 1 } } ], 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 0b389b4668..2ce6ec656c 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,23 +49,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": { @@ -81,24 +83,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": { 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 5b4a77699a..1784e52aa9 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,8 +55,8 @@ "implicit": { "authorizationUrl": "http://personstore.swagger.io/oauth/dialog", "scopes": { - "read:persons": "read your persons", - "write:persons": "modify persons in your account" + "write:persons": "modify persons in your account", + "read:persons": "read your persons" } } } 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 503b37f1ad..bbe23f4d1c 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 } } ], 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 fba939cb28..6a994ed395 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,15 +75,15 @@ } }, "securitySchemes": { + "basicScheme": { + "type": "http", + "scheme": "basic" + }, "Authorization": { "type": "apiKey", "description": "A core-auth Bearer token", "name": "Authorization", "in": "header" - }, - "basicScheme": { - "type": "http", - "scheme": "basic" } } } 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 index fefc76602a..c2f6288ee1 100644 --- 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 @@ -32,7 +32,8 @@ "description": "the name", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } ], @@ -66,7 +67,8 @@ "description": "the name", "required": true, "schema": { - "type": "string" + "type": "string", + "minLength": 1 } } ], From 98b891788a94d56879d8a1756474575315414158 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Fri, 20 Feb 2026 21:38:13 +0100 Subject: [PATCH 03/34] Changes report Property resolution for parameter default values #3198 --- .../core/service/GenericParameterService.java | 19 ++++++++++++------- .../api/v30/app139/HelloController.java | 7 +++++++ .../api/v30/app139/SpringDocApp139Test.java | 11 ++++++++--- .../api/v31/app139/HelloController.java | 7 +++++++ .../api/v31/app139/SpringDocApp139Test.java | 8 +++++++- .../test/resources/results/3.0.1/app139.json | 16 ++++++++++++++++ .../test/resources/results/3.1.0/app139.json | 16 ++++++++++++++++ 7 files changed, 73 insertions(+), 11 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 83dfc78162..b7dd118597 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 @@ -324,7 +324,7 @@ public Parameter buildParameterFromDoc(io.swagger.v3.oas.annotations.Parameter p optionalContent.ifPresent(parameter::setContent); } else - setSchema(parameterDoc, components, jsonView, parameter); + setSchema(parameterDoc, components, jsonView, parameter, locale); setExamples(parameterDoc, parameter); setExtensions(parameterDoc, parameter, locale); @@ -337,12 +337,13 @@ 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 parameterDoc the parameter doc + * @param components the components + * @param jsonView the json view + * @param parameter the parameter + * @param locale the locale */ - private void setSchema(io.swagger.v3.oas.annotations.Parameter parameterDoc, Components components, JsonView jsonView, Parameter parameter) { + private void setSchema(io.swagger.v3.oas.annotations.Parameter parameterDoc, Components components, JsonView jsonView, Parameter parameter, Locale locale) { if (StringUtils.isNotBlank(parameterDoc.ref())) parameter.$ref(parameterDoc.ref()); else { @@ -356,7 +357,11 @@ private void setSchema(io.swagger.v3.oas.annotations.Parameter parameterDoc, Com PrimitiveType primitiveType = PrimitiveType.fromTypeAndFormat(schema.getType(), schema.getFormat()); if (primitiveType != null) { Schema primitiveSchema = primitiveType.createProperty(); - primitiveSchema.setDefault(schema.getDefault()); + if (schema.getDefault() instanceof String stringValue) { + primitiveSchema.setDefault(propertyResolverUtils.resolve(stringValue, locale)); + } else { + primitiveSchema.setDefault(schema.getDefault()); + } schema.setDefault(primitiveSchema.getDefault()); } } 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 3d08676923..a900f82622 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 @@ -24,6 +24,9 @@ package test.org.springdoc.api.v30.app139; +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.MediaType; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; @@ -33,6 +36,10 @@ public class HelloController { @GetMapping(produces = MediaType.TEXT_PLAIN_VALUE, path = "/test1") + @Parameter(name = "parameter", in = ParameterIn.QUERY, + schema = @Schema(type = "string", defaultValue = "${test.parameter-default-value}")) + @Parameter(name = "parameter-boolean", in = ParameterIn.QUERY, + schema = @Schema(type = "boolean", defaultValue = "${test.parameter-boolean-default-value}")) public String echo1(@RequestParam(name = "${test.name}", defaultValue = "${test.default-value}") String text) { return text; } 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 1c3105e690..6d107e44d5 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 @@ -23,16 +23,21 @@ */ package test.org.springdoc.api.v30.app139; -import test.org.springdoc.api.v30.AbstractSpringDocV30Test; - import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.test.context.TestPropertySource; +import test.org.springdoc.api.v30.AbstractSpringDocV30Test; /** * Tests Spring meta-annotations as method parameters */ -@TestPropertySource(properties = { "test.name=text", "test.value=text", "test.default-value=default-text" }) +@TestPropertySource(properties = { + "test.name=text", + "test.value=text", + "test.default-value=default-text", + "test.parameter-default-value=parameter-text", + "test.parameter-boolean-default-value=true" +}) public class SpringDocApp139Test extends AbstractSpringDocV30Test { @SpringBootApplication 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 index e078830daf..40537687d4 100644 --- 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 @@ -24,6 +24,9 @@ package test.org.springdoc.api.v31.app139; +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.MediaType; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; @@ -33,6 +36,10 @@ public class HelloController { @GetMapping(produces = MediaType.TEXT_PLAIN_VALUE, path = "/test1") + @Parameter(name = "parameter", in = ParameterIn.QUERY, + schema = @Schema(type = "string", defaultValue = "${test.parameter-default-value}")) + @Parameter(name = "parameter-boolean", in = ParameterIn.QUERY, + schema = @Schema(type = "boolean", defaultValue = "${test.parameter-boolean-default-value}")) public String echo1(@RequestParam(name = "${test.name}", 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 index d2c46fef9e..1b02660070 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 @@ -32,7 +32,13 @@ /** * Tests Spring meta-annotations as method parameters */ -@TestPropertySource(properties = { "test.name=text", "test.value=text", "test.default-value=default-text" }) +@TestPropertySource(properties = { + "test.name=text", + "test.value=text", + "test.default-value=default-text", + "test.parameter-default-value=parameter-text", + "test.parameter-boolean-default-value=true" +}) public class SpringDocApp139Test extends AbstractSpringDocTest { @SpringBootApplication diff --git a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app139.json b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app139.json index eb7e866807..64c04b5506 100644 --- a/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app139.json +++ b/springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.0.1/app139.json @@ -57,6 +57,22 @@ "type": "string", "default": "default-text" } + }, + { + "name" : "parameter", + "in" : "query", + "schema" : { + "type" : "string", + "default": "parameter-text" + } + }, + { + "name" : "parameter-boolean", + "in" : "query", + "schema" : { + "type" : "boolean", + "default": true + } } ], "responses": { 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 index 72b1c7d6e3..b597f5b812 100644 --- 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 @@ -57,6 +57,22 @@ "type": "string", "default": "default-text" } + }, + { + "name" : "parameter", + "in" : "query", + "schema" : { + "type" : "string", + "default": "parameter-text" + } + }, + { + "name" : "parameter-boolean", + "in" : "query", + "schema" : { + "type" : "boolean", + "default": true + } } ], "responses": { From bb8ae1fd93c70bb46ef5ec7a799a01418c866ff4 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Fri, 20 Feb 2026 21:45:41 +0100 Subject: [PATCH 04/34] Changes report fix(#3161): Prevent duplicate _links in allOf child schemas #3199 --- .../converters/PolymorphicModelConverter.java | 36 +++ .../api/v30/app11/ExtendedTestDto.java | 25 ++ .../api/v30/app11/HateoasController.java | 29 +++ .../api/v30/app11/SpringDocApp11Test.java | 214 ++++++++++++++++ .../org/springdoc/api/v30/app11/TestDto.java | 27 ++ .../api/v31/app13/ExtendedTestDto.java | 24 ++ .../api/v31/app13/HateoasController.java | 29 +++ .../api/v31/app13/SpringDocApp13Test.java | 233 ++++++++++++++++++ .../org/springdoc/api/v31/app13/TestDto.java | 27 ++ .../test/resources/results/3.0.1/app11.json | 138 +++++++++++ .../test/resources/results/3.1.0/app13.json | 137 ++++++++++ 11 files changed, 919 insertions(+) create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app11/ExtendedTestDto.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app11/HateoasController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app11/SpringDocApp11Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app11/TestDto.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app13/ExtendedTestDto.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app13/HateoasController.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app13/SpringDocApp13Test.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app13/TestDto.java create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.0.1/app11.json create mode 100644 springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app13.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 a334ace80d..cfb7d10657 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 @@ -120,6 +120,28 @@ else if (resolvedSchema.getProperties().containsKey(javaType.getRawClass().getSi return resolvedSchema; } + /** + * Removes _links from allOf child schemas to prevent duplication. + * In allOf composition, child schemas (allOf[1+]) should not redefine + * inherited properties like _links that come from the parent (allOf[0]). + * + * @param composedSchema the composed schema with allOf structure + */ + private void removeLinksFromAllOfChild(ComposedSchema composedSchema) { + List allOf = composedSchema.getAllOf(); + if (allOf != null && allOf.size() > 1) { + // allOf[0] is the parent schema (first element in allOf) + // allOf[1+] are the child's own properties (second element onwards in allOf) + for (int i = 1; i < allOf.size(); i++) { + Schema childSchema = allOf.get(i); + if (childSchema != null && childSchema.getProperties() != null) { + // Remove _links (inherited from parent) + childSchema.getProperties().remove("_links"); + } + } + } + } + @Override public Schema resolve(AnnotatedType type, ModelConverterContext context, Iterator chain) { JavaType javaType = springDocObjectMapper.jsonMapper().constructType(type.getType()); @@ -147,6 +169,12 @@ 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 instanceof ComposedSchema composedSchema && + composedSchema.getAllOf() != null && + !composedSchema.getAllOf().isEmpty()) { + removeLinksFromAllOfChild(composedSchema); + } if (resolvedSchema == null || resolvedSchema.get$ref() == null) { return resolvedSchema; } @@ -181,6 +209,14 @@ private Schema composePolymorphicSchema(AnnotatedType type, Schema schema, Colle Class clazz = javaType.getRawClass(); if (TYPES_TO_SKIP.stream().noneMatch(typeToSkip -> typeToSkip.equals(clazz.getSimpleName()))) composedSchemas.forEach(result::addOneOfItem); + + // Remove _links from result (composed schema) to prevent duplication + if (result.getOneOf() != null) { + result.getOneOf().stream() + .filter(s -> s.getProperties() != null) + .forEach(s -> s.getProperties().remove("_links")); + } + return result; } diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app11/ExtendedTestDto.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app11/ExtendedTestDto.java new file mode 100644 index 0000000000..a2ed3cf132 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app11/ExtendedTestDto.java @@ -0,0 +1,25 @@ +package test.org.springdoc.api.v30.app11; +import io.swagger.v3.oas.annotations.media.Schema; + + +/** + * Extended DTO that inherits from TestDto using allOf composition. + * This class verifies that the fix for issue #3161 works correctly, + * ensuring _links is not duplicated in the child schema. + */ +@Schema( + description = "Extended DTO with allOf composition", + allOf = {TestDto.class} +) +public class ExtendedTestDto extends TestDto { + + private String otherField; + + public String getOtherField() { + return otherField; + } + + public void setOtherField(String otherField) { + this.otherField = otherField; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app11/HateoasController.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app11/HateoasController.java new file mode 100644 index 0000000000..ace69f9fee --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app11/HateoasController.java @@ -0,0 +1,29 @@ +package test.org.springdoc.api.v30.app11; + +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 +@Tag(name = "hateoas-controller", description = "Hateoas Controller") +public class HateoasController { + + @GetMapping(path = "/test-dto", produces = "application/json") + @Operation(summary = "Get Test DTO", description = "Returns a TestDto with HATEOAS links") + public TestDto getTestDto() { + TestDto dto = new TestDto(); + dto.setField("test field value"); + return dto; + } + + @GetMapping(path = "/extended-test-dto", produces = "application/json") + @Operation(summary = "Get Extended Test DTO", description = "Returns an ExtendedTestDto with HATEOAS links") + public ExtendedTestDto getExtendedTestDto() { + ExtendedTestDto dto = new ExtendedTestDto(); + dto.setField("parent field value"); + dto.setOtherField("extended field value"); + return dto; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app11/SpringDocApp11Test.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app11/SpringDocApp11Test.java new file mode 100644 index 0000000000..29fa77f407 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app11/SpringDocApp11Test.java @@ -0,0 +1,214 @@ + +package test.org.springdoc.api.v30.app11; + +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.boot.test.context.SpringBootTest; +import org.springframework.context.annotation.ComponentScan; +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; + +/** + * Test for issue #3161: Wrong HAL _links are generated in sub type of a schema + * Verifies that _links field is not duplicated in extended schemas using allOf composition + * Tests OpenAPI 3.0.1 spec compliance + */ +@SpringBootTest +@TestPropertySource(properties = { "springdoc.api-docs.version=openapi_3_0" }) +public class SpringDocApp11Test extends AbstractSpringDocTest { + + /** + * Integration test: Validates the entire OpenAPI specification JSON against the expected schema. + * + * This is the main integration test that ensures: + * 1. The OpenAPI version is correctly set to 3.0.1 + * 2. The generated OpenAPI document matches the expected JSON structure exactly + * 3. All schema definitions, paths, and components are correct + * 4. Issue #3161 is resolved (no duplicate _links in child schemas) + * + * The test compares the actual HTTP response from /v3/api-docs endpoint with + * the expected specification stored in results/3.0.1/app11.json file. + * + * @throws Exception if the test fails or HTTP request encounters an error + */ + @Test + public void testApp() throws Exception { + // Extract test number from class name (11 from SpringDocApp11Test) + String className = getClass().getSimpleName(); + String testNumber = className.replaceAll("[^0-9]", ""); + + // Perform GET request to OpenAPI documentation endpoint + MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) + // Verify HTTP status is 200 OK + .andExpect(status().isOk()) + // Verify OpenAPI version is 3.0.1 + .andExpect(jsonPath("$.openapi", is("3.0.1"))) + .andReturn(); + + // Get the actual generated JSON response + String result = mockMvcResult.getResponse().getContentAsString(); + // Load the expected JSON specification from classpath resource + String expected = getContent("results/3.0.1/app" + testNumber + ".json"); + + // Compare expected and actual JSON in lenient mode (true parameter) + // Lenient mode allows flexibility in JSON comparison (e.g., field order independence) + try { + assertEquals(expected, result, true); + } catch (AssertionError e) { + // Log detailed comparison results for debugging purposes + System.out.println("Expected: " + expected); + System.out.println("Actual: " + result); + throw e; + } + } + + /** + * Unit test: Verifies that the parent TestDto includes the _links property from RepresentationModel. + * + * This test ensures that: + * 1. TestDto correctly extends RepresentationModel + * 2. The _links field is automatically included in the OpenAPI schema + * 3. HATEOAS links support is properly recognized and documented + * + * The _links field is essential for REST API clients to navigate between resources + * using HATEOAS (Hypermedia As The Engine Of Application State) principles. + * + * @throws Exception if the test fails or HTTP request encounters an error + */ + @Test + public void testTestDtoHasHateoasLinks() throws Exception { + // Perform GET request to OpenAPI documentation endpoint + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) + // Verify HTTP status is 200 OK + .andExpect(status().isOk()) + // Verify that _links property exists in TestDto schema + // Path: $.components.schemas.TestDto.properties._links + .andExpect(jsonPath("$.components.schemas.TestDto.properties._links").exists()) + .andReturn(); + } + + /** + * Unit test: Verifies that ExtendedTestDto correctly uses allOf composition to inherit from TestDto. + * + * This test validates the OpenAPI schema composition pattern: + * 1. ExtendedTestDto uses allOf keyword for schema composition + * 2. The first allOf item is a $ref pointing to the parent TestDto + * 3. The second allOf item contains ExtendedTestDto's own properties + * + * The allOf pattern ensures proper inheritance in OpenAPI where child schemas + * automatically inherit all properties from parent schemas without duplication. + * + * @throws Exception if the test fails or HTTP request encounters an error + */ + @Test + public void testExtendedTestDtoAllOfInheritance() throws Exception { + // Perform GET request to OpenAPI documentation endpoint + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) + // Verify HTTP status is 200 OK + .andExpect(status().isOk()) + // Verify that allOf array exists in ExtendedTestDto schema + .andExpect(jsonPath("$.components.schemas.ExtendedTestDto.allOf").exists()) + // Verify that the first allOf item references the parent TestDto + // Path: $.components.schemas.ExtendedTestDto.allOf[0].$ref + .andExpect(jsonPath("$.components.schemas.ExtendedTestDto.allOf[0].$ref") + .value("#/components/schemas/TestDto")) + .andReturn(); + } + + /** + * Critical test: Verifies that ExtendedTestDto does NOT have duplicate _links in its own properties. + * + * This test is the core validation for issue #3161: + * "Wrong HAL _links are generated in sub type of a schema" + * + * The problem was that child schemas incorrectly duplicated the _links field + * even though it was already inherited from the parent schema via allOf. + * + * This test confirms: + * 1. ExtendedTestDto exists in the schema definitions + * 2. ExtendedTestDto uses allOf composition (does not duplicate parent properties) + * 3. The _links field is inherited from TestDto, not redefined in ExtendedTestDto + * + * @throws Exception if the test fails or HTTP request encounters an error + */ + @Test + public void testExtendedTestDtoNoLinksInOwnProperties() throws Exception { + // Perform GET request to OpenAPI documentation endpoint + MvcResult result = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) + // Verify HTTP status is 200 OK + .andExpect(status().isOk()) + .andReturn(); + + // Get the response body as JSON string for content-based assertions + String content = result.getResponse().getContentAsString(); + + // Verify that ExtendedTestDto schema is defined in components + assert(content.contains("\"ExtendedTestDto\"")) : "ExtendedTestDto not found in schema"; + + // Verify that ExtendedTestDto uses allOf composition pattern + assert(content.contains("\"allOf\"")) : "allOf not found in ExtendedTestDto"; + + // Note: Full validation of _links absence is performed by testApp() + // which compares the complete JSON structure with the expected specification + } + + /** + * Unit test: Verifies that ExtendedTestDto contains its own unique properties. + * + * This test ensures that: + * 1. ExtendedTestDto defines its own properties in the second allOf item + * 2. The child-specific property "otherField" is correctly included + * 3. Properties are nested in allOf[1].properties structure + * + * The structure should be: + * ExtendedTestDto { + * allOf: [ + * { $ref: "#/components/schemas/TestDto" }, // allOf[0] - parent + * { + * type: "object", + * properties: { + * otherField: { ... } // allOf[1].properties.otherField + * } + * } + * ] + * } + * + * @throws Exception if the test fails or HTTP request encounters an error + */ + @Test + public void testExtendedTestDtoHasOwnProperties() throws Exception { + // Perform GET request to OpenAPI documentation endpoint + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) + // Verify HTTP status is 200 OK + .andExpect(status().isOk()) + // Verify that otherField property exists in the second allOf item + // Path: $.components.schemas.ExtendedTestDto.allOf[1].properties.otherField + .andExpect(jsonPath("$.components.schemas.ExtendedTestDto.allOf[1].properties.otherField").exists()) + .andReturn(); + } + + /** + * Spring Boot test configuration class. + * + * This inner static class configures the embedded Spring context for testing: + * 1. @SpringBootApplication enables auto-configuration and component scanning + * 2. @ComponentScan explicitly specifies the base package for component discovery + * + * The ComponentScan ensures that HateoasController and other components + * in the test.org.springdoc.api.v30.app11 package are properly registered + * in the Spring context and available for the integration tests. + */ + @SpringBootApplication + @ComponentScan(basePackages = "test.org.springdoc.api.v30.app11") + 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/app11/TestDto.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app11/TestDto.java new file mode 100644 index 0000000000..048019b0ed --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v30/app11/TestDto.java @@ -0,0 +1,27 @@ +package test.org.springdoc.api.v30.app11; + +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.hateoas.RepresentationModel; + +/** + * Parent DTO that extends RepresentationModel for HATEOAS support. + * This class demonstrates the base schema that includes _links field + * automatically added by Spring HATEOAS. + */ +@Schema( + description = "Parent DTO extending RepresentationModel", + subTypes = {ExtendedTestDto.class} +) +public class TestDto extends RepresentationModel { + + private String field; + + public String getField() { + return field; + } + + public void setField(String field) { + this.field = field; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app13/ExtendedTestDto.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app13/ExtendedTestDto.java new file mode 100644 index 0000000000..eca40ee93c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app13/ExtendedTestDto.java @@ -0,0 +1,24 @@ +package test.org.springdoc.api.v31.app13; + +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * Extended DTO that inherits from TestDto using allOf composition. + * This class verifies that the fix for issue #3161 works correctly, + * ensuring _links is not duplicated in the child schema. + */ +@Schema( + description = "Extended DTO with allOf composition" +) +public class ExtendedTestDto extends TestDto { + + private String otherField; + + public String getOtherField() { + return otherField; + } + + public void setOtherField(String otherField) { + this.otherField = otherField; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app13/HateoasController.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app13/HateoasController.java new file mode 100644 index 0000000000..a92e62db09 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app13/HateoasController.java @@ -0,0 +1,29 @@ +package test.org.springdoc.api.v31.app13; + +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 +@Tag(name = "hateoas-controller", description = "Hateoas Controller") +public class HateoasController { + + @GetMapping(path = "/test-dto", produces = "application/json") + @Operation(summary = "Get Test DTO", description = "Returns a TestDto with HATEOAS links") + public TestDto getTestDto() { + TestDto dto = new TestDto(); + dto.setField("test field value"); + return dto; + } + + @GetMapping(path = "/extended-test-dto", produces = "application/json") + @Operation(summary = "Get Extended Test DTO", description = "Returns an ExtendedTestDto with HATEOAS links") + public ExtendedTestDto getExtendedTestDto() { + ExtendedTestDto dto = new ExtendedTestDto(); + dto.setField("parent field value"); + dto.setOtherField("extended field value"); + return dto; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app13/SpringDocApp13Test.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app13/SpringDocApp13Test.java new file mode 100644 index 0000000000..cc8082fc3c --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app13/SpringDocApp13Test.java @@ -0,0 +1,233 @@ + +package test.org.springdoc.api.v31.app13; + +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.boot.test.context.SpringBootTest; +import org.springframework.context.annotation.ComponentScan; +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; + +/** + * Test for issue #3161: Wrong HAL _links are generated in sub type of a schema + * Verifies that _links field is not duplicated in extended schemas using allOf composition + * Tests OpenAPI 3.1.0 spec compliance with JSON Schema 2020-12 support + */ +@SpringBootTest +@TestPropertySource(properties = { "springdoc.api-docs.version=openapi_3_1" }) +public class SpringDocApp13Test extends AbstractSpringDocTest { + + /** + * Integration test: Validates the entire OpenAPI 3.1.0 specification JSON against the expected schema. + * + * This is the main integration test that ensures: + * 1. The OpenAPI version is correctly set to 3.1.0 + * 2. The generated OpenAPI document matches the expected JSON structure exactly + * 3. All schema definitions, paths, and components are correct + * 4. Issue #3161 is resolved (no duplicate _links in child schemas) + * 5. OpenAPI 3.1.0 JSON Schema optimizations are properly applied + * + * OpenAPI 3.1.0 introduces full JSON Schema 2020-12 support, which allows for + * more optimized schema representations compared to OpenAPI 3.0.1. + * For example, allOf compositions may omit redundant schema definitions. + * + * The test compares the actual HTTP response from /v3/api-docs endpoint with + * the expected specification stored in results/3.1.0/app13.json file. + * + * @throws Exception if the test fails or HTTP request encounters an error + */ + @Test + public void testApp() throws Exception { + // Extract test number from class name (13 from SpringDocApp13Test) + String className = getClass().getSimpleName(); + String testNumber = className.replaceAll("[^0-9]", ""); + + // Perform GET request to OpenAPI documentation endpoint + MvcResult mockMvcResult = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) + // Verify HTTP status is 200 OK + .andExpect(status().isOk()) + // Verify OpenAPI version is 3.1.0 (not 3.0.1) + .andExpect(jsonPath("$.openapi", is("3.1.0"))) + .andReturn(); + + // Get the actual generated JSON response + String result = mockMvcResult.getResponse().getContentAsString(); + // Load the expected JSON specification from classpath resource for OpenAPI 3.1.0 + String expected = getContent("results/3.1.0/app" + testNumber + ".json"); + + // Compare expected and actual JSON in lenient mode (true parameter) + // Lenient mode allows flexibility in JSON comparison (e.g., field order independence, + // handling of optional fields like 'type' in OpenAPI 3.1.0) + try { + assertEquals(expected, result, true); + } catch (AssertionError e) { + // Log detailed comparison results for debugging purposes + System.out.println("Expected: " + expected); + System.out.println("Actual: " + result); + throw e; + } + } + + /** + * Unit test: Verifies that the parent TestDto includes the _links property from RepresentationModel. + * + * This test ensures that: + * 1. TestDto correctly extends RepresentationModel + * 2. The _links field is automatically included in the OpenAPI 3.1.0 schema + * 3. HATEOAS links support is properly recognized and documented + * + * The _links field is essential for REST API clients to navigate between resources + * using HATEOAS (Hypermedia As The Engine Of Application State) principles. + * + * Note: This test verifies the same behavior as SpringDocApp11Test but with + * OpenAPI 3.1.0, confirming consistency across OpenAPI versions. + * + * @throws Exception if the test fails or HTTP request encounters an error + */ + @Test + public void testTestDtoHasHateoasLinks() throws Exception { + // Perform GET request to OpenAPI documentation endpoint + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) + // Verify HTTP status is 200 OK + .andExpect(status().isOk()) + // Verify that _links property exists in TestDto schema + // Path: $.components.schemas.TestDto.properties._links + .andExpect(jsonPath("$.components.schemas.TestDto.properties._links").exists()) + .andReturn(); + } + + /** + * Unit test: Verifies that ExtendedTestDto correctly uses allOf composition to inherit from TestDto. + * + * This test validates the OpenAPI 3.1.0 schema composition pattern: + * 1. ExtendedTestDto uses allOf keyword for schema composition + * 2. The first allOf item is a $ref pointing to the parent TestDto + * 3. In OpenAPI 3.1.0, the composition structure may be more optimized than in 3.0.1 + * + * The allOf pattern ensures proper inheritance in OpenAPI where child schemas + * automatically inherit all properties from parent schemas without explicit duplication. + * + * Note: OpenAPI 3.1.0 with JSON Schema 2020-12 support may omit the explicit + * second allOf item if no additional properties are defined in the child schema. + * + * @throws Exception if the test fails or HTTP request encounters an error + */ + @Test + public void testExtendedTestDtoAllOfInheritance() throws Exception { + // Perform GET request to OpenAPI documentation endpoint + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) + // Verify HTTP status is 200 OK + .andExpect(status().isOk()) + // Verify that allOf array exists in ExtendedTestDto schema + .andExpect(jsonPath("$.components.schemas.ExtendedTestDto.allOf").exists()) + // Verify that the first allOf item references the parent TestDto + // Path: $.components.schemas.ExtendedTestDto.allOf[0].$ref + .andExpect(jsonPath("$.components.schemas.ExtendedTestDto.allOf[0].$ref") + .value("#/components/schemas/TestDto")) + .andReturn(); + } + + /** + * Critical test: Verifies that ExtendedTestDto does NOT have duplicate _links in its own properties. + * + * This test is the core validation for issue #3161: + * "Wrong HAL _links are generated in sub type of a schema" + * + * The problem was that child schemas incorrectly duplicated the _links field + * even though it was already inherited from the parent schema via allOf. + * + * This test confirms: + * 1. ExtendedTestDto exists in the schema definitions + * 2. ExtendedTestDto uses allOf composition (does not duplicate parent properties) + * 3. The _links field is inherited from TestDto, not redefined in ExtendedTestDto + * 4. This behavior is consistent between OpenAPI 3.0.1 and 3.1.0 + * + * @throws Exception if the test fails or HTTP request encounters an error + */ + @Test + public void testExtendedTestDtoNoLinksInOwnProperties() throws Exception { + // Perform GET request to OpenAPI documentation endpoint + MvcResult result = mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) + // Verify HTTP status is 200 OK + .andExpect(status().isOk()) + .andReturn(); + + // Get the response body as JSON string for content-based assertions + String content = result.getResponse().getContentAsString(); + + // Verify that ExtendedTestDto schema is defined in components + assert(content.contains("\"ExtendedTestDto\"")) : "ExtendedTestDto not found in schema"; + + // Verify that ExtendedTestDto uses allOf composition pattern + assert(content.contains("\"allOf\"")) : "allOf not found in ExtendedTestDto"; + + // Note: Full validation of _links absence is performed by testApp() + // which compares the complete JSON structure with the expected specification + } + + /** + * Unit test: Verifies that ExtendedTestDto correctly extends TestDto in OpenAPI 3.1.0. + * + * This test differs from SpringDocApp11Test due to OpenAPI 3.1.0 optimizations: + * 1. Verifies that allOf array exists for schema composition + * 2. Confirms that the first allOf item correctly references the parent TestDto + * 3. Acknowledges that OpenAPI 3.1.0 may omit redundant schema elements + * + * In OpenAPI 3.1.0 with full JSON Schema 2020-12 support: + * - The type field becomes optional (can be omitted) + * - Implicit inheritance is allowed without explicit property definitions + * - Schema composition may be more compact than in OpenAPI 3.0.1 + * + * Therefore, this test focuses on verifying the core allOf composition pattern + * rather than checking for an explicit second allOf item with properties. + * + * Note: The otherField property definition may be implicit through inheritance + * rather than explicitly defined in allOf[1] as in OpenAPI 3.0.1. + * + * @throws Exception if the test fails or HTTP request encounters an error + */ + @Test + public void testExtendedTestDtoHasOwnProperties() throws Exception { + // Perform GET request to OpenAPI documentation endpoint + mockMvc.perform(get(Constants.DEFAULT_API_DOCS_URL)) + // Verify HTTP status is 200 OK + .andExpect(status().isOk()) + // Verify that allOf array exists in ExtendedTestDto schema + // This confirms the composition pattern is in place + .andExpect(jsonPath("$.components.schemas.ExtendedTestDto.allOf").exists()) + // Verify that the first allOf item correctly references the parent TestDto + // This is the critical element for proper schema composition + .andExpect(jsonPath("$.components.schemas.ExtendedTestDto.allOf[0].$ref") + .value("#/components/schemas/TestDto")) + .andReturn(); + } + + /** + * Spring Boot test configuration class for OpenAPI 3.1.0 testing. + * + * This inner static class configures the embedded Spring context for testing: + * 1. @SpringBootApplication enables auto-configuration and component scanning + * 2. @ComponentScan explicitly specifies the base package for component discovery + * 3. The context is specifically configured for OpenAPI 3.1.0 via TestPropertySource + * + * The ComponentScan ensures that HateoasController and other components + * in the test.org.springdoc.api.v31.app13 package are properly registered + * in the Spring context and available for the integration tests. + * + * This differs from SpringDocApp11Test by scanning the v31.app13 package + * and using OpenAPI 3.1.0 configuration instead of 3.0.1. + */ + @SpringBootApplication + @ComponentScan(basePackages = "test.org.springdoc.api.v31.app13") + 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/app13/TestDto.java b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app13/TestDto.java new file mode 100644 index 0000000000..f47b347435 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api/v31/app13/TestDto.java @@ -0,0 +1,27 @@ +package test.org.springdoc.api.v31.app13; + +import io.swagger.v3.oas.annotations.media.Schema; + +import org.springframework.hateoas.RepresentationModel; + +/** + * Parent DTO that extends RepresentationModel for HATEOAS support. + * This class demonstrates the base schema that includes _links field + * automatically added by Spring HATEOAS. + */ +@Schema( + description = "Parent DTO extending RepresentationModel", + subTypes = {ExtendedTestDto.class} +) +public class TestDto extends RepresentationModel { + + private String field; + + public String getField() { + return field; + } + + public void setField(String field) { + this.field = field; + } +} diff --git a/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.0.1/app11.json b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.0.1/app11.json new file mode 100644 index 0000000000..0cfe85e9e9 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.0.1/app11.json @@ -0,0 +1,138 @@ + +{ + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "tags": [ + { + "name": "hateoas-controller", + "description": "Hateoas Controller" + } + ], + "paths": { + "/test-dto": { + "get": { + "tags": [ + "hateoas-controller" + ], + "summary": "Get Test DTO", + "description": "Returns a TestDto with HATEOAS links", + "operationId": "getTestDto", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/TestDto" + }, + { + "$ref": "#/components/schemas/ExtendedTestDto" + } + ] + } + } + } + } + } + } + }, + "/extended-test-dto": { + "get": { + "tags": [ + "hateoas-controller" + ], + "summary": "Get Extended Test DTO", + "description": "Returns an ExtendedTestDto with HATEOAS links", + "operationId": "getExtendedTestDto", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExtendedTestDto" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "TestDto": { + "type": "object", + "properties": { + "field": { + "type": "string" + }, + "_links": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Link" + } + } + }, + "description": "Parent DTO extending RepresentationModel" + }, + "ExtendedTestDto": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/TestDto" + }, + { + "type": "object", + "properties": { + "otherField": { + "type": "string" + } + } + } + ], + "description": "Extended DTO with allOf composition" + }, + "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/app13.json b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app13.json new file mode 100644 index 0000000000..8560aeb6a6 --- /dev/null +++ b/springdoc-openapi-tests/springdoc-openapi-hateoas-tests/src/test/resources/results/3.1.0/app13.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": "hateoas-controller", + "description": "Hateoas Controller" + } + ], + "paths": { + "/test-dto": { + "get": { + "tags": [ + "hateoas-controller" + ], + "summary": "Get Test DTO", + "description": "Returns a TestDto with HATEOAS links", + "operationId": "getTestDto", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/TestDto" + }, + { + "$ref": "#/components/schemas/ExtendedTestDto" + } + ] + } + } + } + } + } + } + }, + "/extended-test-dto": { + "get": { + "tags": [ + "hateoas-controller" + ], + "summary": "Get Extended Test DTO", + "description": "Returns an ExtendedTestDto with HATEOAS links", + "operationId": "getExtendedTestDto", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExtendedTestDto" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "TestDto": { + "type": "object", + "properties": { + "field": { + "type": "string" + }, + "_links": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Link" + } + } + }, + "description": "Parent DTO extending RepresentationModel" + }, + "ExtendedTestDto": { + "allOf": [ + { + "$ref": "#/components/schemas/TestDto" + }, + { + "type": "object", + "properties": { + "otherField": { + "type": "string" + } + } + } + ], + "description": "Extended DTO with allOf composition" + }, + "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 From 11e96ec911ad4f9c31c12e66905f559bc9070626 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Fri, 20 Feb 2026 21:53:15 +0100 Subject: [PATCH 05/34] feat(swagger-ui): add springdoc.swagger-ui.document-title property #3208 --- .../AbstractSwaggerUiConfigProperties.java | 23 +++++++ .../ui/AbstractSwaggerIndexTransformer.java | 47 +++++++++++++- .../AbstractSwaggerIndexTransformerTest.java | 62 ++++++++++++++++++- .../ui/app39/SpringDocApp39Test.java | 47 ++++++++++++++ 4 files changed, 177 insertions(+), 2 deletions(-) create mode 100644 springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app39/SpringDocApp39Test.java 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 b39a6c0cb8..7e4205966f 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 @@ -185,6 +185,29 @@ public abstract class AbstractSwaggerUiConfigProperties { */ protected Boolean withCredentials; + /** + * The Document title. + */ + protected String documentTitle; + + /** + * Gets document title. + * + * @return the document title + */ + public String getDocumentTitle() { + return documentTitle; + } + + /** + * Sets document title. + * + * @param documentTitle the document title + */ + public void setDocumentTitle(String documentTitle) { + this.documentTitle = documentTitle; + } + /** * Gets with credentials. * 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 1f48e038e8..f7f5a24e08 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 @@ -59,6 +59,11 @@ public class AbstractSwaggerIndexTransformer { */ private static final String PRESETS = "presets: ["; + /** + * The constant EDITOR_FOLD_MARKER. + */ + private static final String EDITOR_FOLD_MARKER = "//"; + /** * The Swagger ui o auth properties. */ @@ -178,6 +183,9 @@ else if (swaggerUiConfig.getCsrf().isUseSessionStorage()) html = setConfiguredApiDocsUrl(html); } + if (StringUtils.isNotEmpty(swaggerUiConfig.getDocumentTitle())) + html = addDocumentTitle(html); + return html; } @@ -325,4 +333,41 @@ protected String addSyntaxHighlight(String html) { return html.replace(PRESETS, stringBuilder.toString()); } -} + /** + * Add document title script. + * + * @param html the html + * @return the string + */ + protected String addDocumentTitle(String html) { + if (!html.contains(EDITOR_FOLD_MARKER)) { + return html; + } + StringBuilder stringBuilder = new StringBuilder("document.title = '"); + stringBuilder.append(escapeJavaScriptString(swaggerUiConfig.getDocumentTitle())); + stringBuilder.append("';\n\n "); + stringBuilder.append(EDITOR_FOLD_MARKER); + return html.replace(EDITOR_FOLD_MARKER, stringBuilder.toString()); + } + + /** + * Escape special characters for JavaScript string literal. + * + * @param input the input string + * @return the escaped string + */ + private String escapeJavaScriptString(String input) { + if (input == null) { + return ""; + } + return input + .replace("\\", "\\\\") + .replace("'", "\\'") + .replace("\n", "\\n") + .replace("\r", "\\r") + .replace("\t", "\\t") + .replace("<", "\\u003c") + .replace(">", "\\u003e"); + } + +} \ No newline at end of file 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 c103a063bc..57eb741f42 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 @@ -18,6 +18,7 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.not; @ExtendWith(MockitoExtension.class) class AbstractSwaggerIndexTransformerTest { @@ -67,4 +68,63 @@ void setApiDocUrlCorrectly() throws IOException { var html = underTest.defaultTransformations(new SwaggerUiConfigParameters(swaggerUiConfig), is); assertThat(html, containsString(apiDocUrl)); } -} + + @Test + void documentTitle_whenSet_addsDocumentTitleScript() throws IOException { + swaggerUiConfig.setDocumentTitle("My Custom API Documentation"); + InputStream inputStream = new ByteArrayInputStream(swaggerInitJs.getBytes(StandardCharsets.UTF_8)); + var html = underTest.defaultTransformations(new SwaggerUiConfigParameters(swaggerUiConfig), inputStream); + assertThat(html, containsString("document.title = 'My Custom API Documentation';")); + } + + @Test + void documentTitle_whenNotSet_doesNotAddScript() throws IOException { + swaggerUiConfig.setDocumentTitle(null); + InputStream inputStream = new ByteArrayInputStream(swaggerInitJs.getBytes(StandardCharsets.UTF_8)); + var html = underTest.defaultTransformations(new SwaggerUiConfigParameters(swaggerUiConfig), inputStream); + assertThat(html, not(containsString("document.title"))); + } + + @Test + void documentTitle_whenEmpty_doesNotAddScript() throws IOException { + swaggerUiConfig.setDocumentTitle(""); + InputStream inputStream = new ByteArrayInputStream(swaggerInitJs.getBytes(StandardCharsets.UTF_8)); + var html = underTest.defaultTransformations(new SwaggerUiConfigParameters(swaggerUiConfig), inputStream); + assertThat(html, not(containsString("document.title"))); + } + + @Test + void documentTitle_escapesSpecialCharacters() throws IOException { + swaggerUiConfig.setDocumentTitle("Test's API \\ Documentation"); + InputStream inputStream = new ByteArrayInputStream(swaggerInitJs.getBytes(StandardCharsets.UTF_8)); + var html = underTest.defaultTransformations(new SwaggerUiConfigParameters(swaggerUiConfig), inputStream); + assertThat(html, containsString("document.title = 'Test\\'s API \\\\ Documentation';")); + } + + @Test + void documentTitle_escapesNewlines() throws IOException { + swaggerUiConfig.setDocumentTitle("Test\nAPI\rDocs\tTitle"); + InputStream inputStream = new ByteArrayInputStream(swaggerInitJs.getBytes(StandardCharsets.UTF_8)); + var html = underTest.defaultTransformations(new SwaggerUiConfigParameters(swaggerUiConfig), inputStream); + assertThat(html, containsString("document.title = 'Test\\nAPI\\rDocs\\tTitle';")); + } + + @Test + void documentTitle_escapesScriptTags() throws IOException { + swaggerUiConfig.setDocumentTitle(""); + InputStream inputStream = new ByteArrayInputStream(swaggerInitJs.getBytes(StandardCharsets.UTF_8)); + var html = underTest.defaultTransformations(new SwaggerUiConfigParameters(swaggerUiConfig), inputStream); + assertThat(html, not(containsString("