From 0b11833e48af8d9b530093d325bfd961782f48b9 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 12 Jan 2025 01:56:42 +0100 Subject: [PATCH] Provide better compatibility for projects migrating from OAS 3.0 to OAS 3.1. Fixes #2849 --- .../api/v30/app12/EnumController.java | 18 ------------------ .../api/v30/app12/SpringDocApp12Test.kt | 2 +- .../api/v31/app12/EnumController.java | 18 ------------------ .../api/v31/app12/SpringDocApp12Test.kt | 2 +- 4 files changed, 2 insertions(+), 38 deletions(-) delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app12/EnumController.java delete mode 100644 springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app12/EnumController.java diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app12/EnumController.java b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app12/EnumController.java deleted file mode 100644 index d66aa497f..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app12/EnumController.java +++ /dev/null @@ -1,18 +0,0 @@ -package test.org.springdoc.api.v30.app12; - -import jakarta.annotation.Nullable; -import test.org.springdoc.api.v30.app12.SpringDocApp12Test.MyEnum; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * @author bnasslahsen - */ -@RestController -public class EnumController { - @GetMapping("/test-enum-2") - String testEnum2(@Nullable MyEnum e) { - return ""; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app12/SpringDocApp12Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app12/SpringDocApp12Test.kt index b64b2d186..448192da6 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app12/SpringDocApp12Test.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app12/SpringDocApp12Test.kt @@ -25,7 +25,7 @@ import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest class SpringDocApp12Test : AbstractKotlinSpringDocMVCTest() { @SpringBootApplication - @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v30.app12"]) + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v30.app12", "test.org.springdoc.api.app12"]) class DemoApplication enum class MyEnum { diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app12/EnumController.java b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app12/EnumController.java deleted file mode 100644 index 84bd951a6..000000000 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app12/EnumController.java +++ /dev/null @@ -1,18 +0,0 @@ -package test.org.springdoc.api.v31.app12; - -import jakarta.annotation.Nullable; -import test.org.springdoc.api.v30.app12.SpringDocApp12Test.MyEnum; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * @author bnasslahsen - */ -@RestController -public class EnumController { - @GetMapping("/test-enum-2") - String testEnum2(@Nullable MyEnum e) { - return ""; - } -} \ No newline at end of file diff --git a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app12/SpringDocApp12Test.kt b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app12/SpringDocApp12Test.kt index 1eb24c835..a5c7ad736 100644 --- a/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app12/SpringDocApp12Test.kt +++ b/springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app12/SpringDocApp12Test.kt @@ -25,7 +25,7 @@ import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest class SpringDocApp12Test : AbstractKotlinSpringDocMVCTest() { @SpringBootApplication - @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v31.app12"]) + @ComponentScan(basePackages = ["org.springdoc", "test.org.springdoc.api.v31.app12", "test.org.springdoc.api.app12"]) class DemoApplication enum class MyEnum {