diff --git a/.github/release/maven-settings.xml.gpg b/.github/release/maven-settings.xml.gpg deleted file mode 100644 index d25987610..000000000 Binary files a/.github/release/maven-settings.xml.gpg and /dev/null differ diff --git a/.github/release/smallrye-sign.asc.gpg b/.github/release/smallrye-sign.asc.gpg deleted file mode 100644 index ffd7b0f07..000000000 Binary files a/.github/release/smallrye-sign.asc.gpg and /dev/null differ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6713a70fd..3c253c720 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,27 +30,26 @@ jobs: with: distribution: 'temurin' java-version: 17 - - - name: maven cache - uses: actions/cache@v4 - with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 + server-id: 'oss.sonatype' + server-username: 'MAVEN_DEPLOY_USERNAME' + server-password: 'MAVEN_DEPLOY_TOKEN' + gpg-private-key: ${{secrets.MAVEN_GPG_PRIVATE_KEY}} + gpg-passphrase: 'MAVEN_GPG_PASSPHRASE' - name: maven release ${{steps.metadata.outputs.current-version}} + env: + MAVEN_DEPLOY_USERNAME: ${{secrets.MAVEN_DEPLOY_USERNAME}} + MAVEN_DEPLOY_TOKEN: ${{secrets.MAVEN_DEPLOY_TOKEN}} + MAVEN_GPG_PASSPHRASE: ${{secrets.MAVEN_GPG_PASSPHRASE}} run: | java -version - gpg --quiet --batch --yes --decrypt --passphrase="${{secrets.SECRET_PASSPHRASE}}" --output smallrye-sign.asc .github/release/smallrye-sign.asc.gpg - gpg --quiet --batch --yes --decrypt --passphrase="${{secrets.SECRET_PASSPHRASE}}" --output maven-settings.xml .github/release/maven-settings.xml.gpg - gpg --fast-import --no-tty --batch --yes smallrye-sign.asc git config --global user.name "SmallRye CI" git config --global user.email "smallrye@googlegroups.com" git checkout -b release - mvn -B release:prepare -Prelease -DreleaseVersion=${{steps.metadata.outputs.current-version}} -DdevelopmentVersion=${{steps.metadata.outputs.next-version}} -s maven-settings.xml + mvn -B release:prepare -Prelease -DreleaseVersion=${{steps.metadata.outputs.current-version}} -DdevelopmentVersion=${{steps.metadata.outputs.next-version}} git checkout ${{github.base_ref}} git rebase release - mvn -B release:perform -Prelease -s maven-settings.xml + mvn -B release:perform -Prelease git push git push --tags diff --git a/core/src/main/java/io/smallrye/openapi/spi/OASFactoryResolverImpl.java b/core/src/main/java/io/smallrye/openapi/spi/OASFactoryResolverImpl.java index 0d42af2cf..f22af97e9 100644 --- a/core/src/main/java/io/smallrye/openapi/spi/OASFactoryResolverImpl.java +++ b/core/src/main/java/io/smallrye/openapi/spi/OASFactoryResolverImpl.java @@ -78,43 +78,44 @@ */ public class OASFactoryResolverImpl extends OASFactoryResolver { - private static final Map, Supplier> registry = new HashMap<>(); + private static class OASFactoryResolverRegistry { - static void put(Class key, Supplier value) { - registry.put(key, value); - } + private static final Map, Supplier> REGISTRY; - static { - put(APIResponse.class, APIResponseImpl::new); - put(APIResponses.class, APIResponsesImpl::new); - put(Callback.class, CallbackImpl::new); - put(Components.class, ComponentsImpl::new); - put(Contact.class, ContactImpl::new); - put(Content.class, ContentImpl::new); - put(Discriminator.class, DiscriminatorImpl::new); - put(Encoding.class, EncodingImpl::new); - put(Example.class, ExampleImpl::new); - put(ExternalDocumentation.class, ExternalDocumentationImpl::new); - put(Header.class, HeaderImpl::new); - put(Info.class, InfoImpl::new); - put(License.class, LicenseImpl::new); - put(Link.class, LinkImpl::new); - put(MediaType.class, MediaTypeImpl::new); - put(OAuthFlow.class, OAuthFlowImpl::new); - put(OAuthFlows.class, OAuthFlowsImpl::new); - put(OpenAPI.class, OpenAPIImpl::new); - put(Operation.class, OperationImpl::new); - put(Parameter.class, ParameterImpl::new); - put(PathItem.class, PathItemImpl::new); - put(Paths.class, PathsImpl::new); - put(RequestBody.class, RequestBodyImpl::new); - put(Schema.class, SchemaImpl::new); - put(SecurityRequirement.class, SecurityRequirementImpl::new); - put(SecurityScheme.class, SecuritySchemeImpl::new); - put(Server.class, ServerImpl::new); - put(ServerVariable.class, ServerVariableImpl::new); - put(Tag.class, TagImpl::new); - put(XML.class, XMLImpl::new); + static { + Map, Supplier> registry = new HashMap<>(30); + registry.put(APIResponse.class, APIResponseImpl::new); + registry.put(APIResponses.class, APIResponsesImpl::new); + registry.put(Callback.class, CallbackImpl::new); + registry.put(Components.class, ComponentsImpl::new); + registry.put(Contact.class, ContactImpl::new); + registry.put(Content.class, ContentImpl::new); + registry.put(Discriminator.class, DiscriminatorImpl::new); + registry.put(Encoding.class, EncodingImpl::new); + registry.put(Example.class, ExampleImpl::new); + registry.put(ExternalDocumentation.class, ExternalDocumentationImpl::new); + registry.put(Header.class, HeaderImpl::new); + registry.put(Info.class, InfoImpl::new); + registry.put(License.class, LicenseImpl::new); + registry.put(Link.class, LinkImpl::new); + registry.put(MediaType.class, MediaTypeImpl::new); + registry.put(OAuthFlow.class, OAuthFlowImpl::new); + registry.put(OAuthFlows.class, OAuthFlowsImpl::new); + registry.put(OpenAPI.class, OpenAPIImpl::new); + registry.put(Operation.class, OperationImpl::new); + registry.put(Parameter.class, ParameterImpl::new); + registry.put(PathItem.class, PathItemImpl::new); + registry.put(Paths.class, PathsImpl::new); + registry.put(RequestBody.class, RequestBodyImpl::new); + registry.put(Schema.class, SchemaImpl::new); + registry.put(SecurityRequirement.class, SecurityRequirementImpl::new); + registry.put(SecurityScheme.class, SecuritySchemeImpl::new); + registry.put(Server.class, ServerImpl::new); + registry.put(ServerVariable.class, ServerVariableImpl::new); + registry.put(Tag.class, TagImpl::new); + registry.put(XML.class, XMLImpl::new); + REGISTRY = registry; + } } /** @@ -124,7 +125,7 @@ static void put(Class key, Supplier @Override public T createObject(Class clazz) { Objects.requireNonNull(clazz, "clazz"); - return (T) registry.getOrDefault(clazz, () -> this.unknownType(clazz)).get(); + return (T) OASFactoryResolverRegistry.REGISTRY.getOrDefault(clazz, () -> this.unknownType(clazz)).get(); } T unknownType(Class clazz) { diff --git a/extension-jaxrs/pom.xml b/extension-jaxrs/pom.xml index f6ec6618f..20216f0a1 100644 --- a/extension-jaxrs/pom.xml +++ b/extension-jaxrs/pom.xml @@ -71,7 +71,7 @@ org.jetbrains.kotlin kotlin-stdlib - 1.9.23 + 2.0.0 test diff --git a/extension-spring/pom.xml b/extension-spring/pom.xml index 13f40bb8d..35922495f 100644 --- a/extension-spring/pom.xml +++ b/extension-spring/pom.xml @@ -13,7 +13,7 @@ SmallRye: OpenAPI extension - Spring - 5.3.34 + 5.3.36 @@ -63,6 +63,17 @@ spring-webmvc test + + javax.servlet + javax.servlet-api + 4.0.1 + test + + + jakarta.servlet + jakarta.servlet-api + test + diff --git a/extension-spring/src/main/java/io/smallrye/openapi/spring/SpringAnnotationScanner.java b/extension-spring/src/main/java/io/smallrye/openapi/spring/SpringAnnotationScanner.java index 2e3e03e0a..70d5a4980 100644 --- a/extension-spring/src/main/java/io/smallrye/openapi/spring/SpringAnnotationScanner.java +++ b/extension-spring/src/main/java/io/smallrye/openapi/spring/SpringAnnotationScanner.java @@ -93,6 +93,11 @@ public boolean isMultipartInput(Type inputType) { return SpringConstants.MULTIPART_INPUTS.contains(inputType.name()); } + @Override + public boolean isFrameworkContextType(Type type) { + return SpringConstants.CONTEXTS.contains(type.name()); + } + @Override public boolean containsScannerAnnotations(List instances, List extensions) { diff --git a/extension-spring/src/main/java/io/smallrye/openapi/spring/SpringConstants.java b/extension-spring/src/main/java/io/smallrye/openapi/spring/SpringConstants.java index df47e387a..51d58d14f 100644 --- a/extension-spring/src/main/java/io/smallrye/openapi/spring/SpringConstants.java +++ b/extension-spring/src/main/java/io/smallrye/openapi/spring/SpringConstants.java @@ -4,6 +4,8 @@ import java.util.Collections; import java.util.HashSet; import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; import org.jboss.jandex.DotName; @@ -34,6 +36,14 @@ public class SpringConstants { static final DotName HEADER_PARAM = DotName.createSimple("org.springframework.web.bind.annotation.RequestHeader"); static final DotName MATRIX_PARAM = DotName.createSimple("org.springframework.web.bind.annotation.MatrixVariable"); + static final Set CONTEXTS = Stream.of("javax", "jakarta") + .map(prefix -> DotName.createComponentized(null, prefix)) + .map(prefix -> DotName.createComponentized(prefix, "servlet")) + .map(prefix -> DotName.createComponentized(prefix, "http")) + .flatMap(prefix -> Stream.of("HttpServletRequest", "HttpServletResponse", "HttpSession") + .map(simpleName -> DotName.createComponentized(prefix, simpleName))) + .collect(Collectors.toSet()); + public static final Set MULTIPART_OUTPUTS = Collections .unmodifiableSet(new HashSet<>(Arrays.asList(MUTIPART_FILE))); diff --git a/extension-spring/src/test/java/io/smallrye/openapi/runtime/scanner/SpringAnnotationScannerTest.java b/extension-spring/src/test/java/io/smallrye/openapi/runtime/scanner/SpringAnnotationScannerTest.java index 82a5dc89a..e65c24231 100644 --- a/extension-spring/src/test/java/io/smallrye/openapi/runtime/scanner/SpringAnnotationScannerTest.java +++ b/extension-spring/src/test/java/io/smallrye/openapi/runtime/scanner/SpringAnnotationScannerTest.java @@ -17,6 +17,8 @@ import test.io.smallrye.openapi.runtime.scanner.resources.GreetingPostControllerAlt; import test.io.smallrye.openapi.runtime.scanner.resources.GreetingPutController; import test.io.smallrye.openapi.runtime.scanner.resources.GreetingPutControllerAlt; +import test.io.smallrye.openapi.runtime.scanner.resources.javax.GreetingPostControllerWithServletContext; +import test.io.smallrye.openapi.runtime.scanner.resources.javax.GreetingPutControllerWithServletContext; /** * Basic Spring annotation scanning @@ -114,6 +116,44 @@ void testBasicPostSpringDefinitionScanningAlt() throws IOException, JSONExceptio assertJsonEquals("resource.testBasicSpringPostDefinitionScanning.json", result); } + /** + * This test a basic, no OpenApi annotations, hello world service + * + * @throws IOException + * @throws JSONException + */ + @Test + void testBasicPostSpringDefinitionScanningWithServletContextJakarta() throws IOException, JSONException { + Index i = indexOf( + test.io.smallrye.openapi.runtime.scanner.resources.jakarta.GreetingPostControllerWithServletContext.class, + Greeting.class); + OpenApiAnnotationScanner scanner = new OpenApiAnnotationScanner(emptyConfig(), i); + + OpenAPI result = scanner.scan(); + + printToConsole(result); + assertJsonEquals("resource.testBasicSpringPostDefinitionScanning.json", result); + } + + /** + * This test a basic, no OpenApi annotations, hello world service + * + * @throws IOException + * @throws JSONException + */ + @Test + void testBasicPostSpringDefinitionScanningWithServletContextJavax() throws IOException, JSONException { + Index i = indexOf( + test.io.smallrye.openapi.runtime.scanner.resources.javax.GreetingPostControllerWithServletContext.class, + Greeting.class); + OpenApiAnnotationScanner scanner = new OpenApiAnnotationScanner(emptyConfig(), i); + + OpenAPI result = scanner.scan(); + + printToConsole(result); + assertJsonEquals("resource.testBasicSpringPostDefinitionScanning.json", result); + } + /** * This test a basic, no OpenApi annotations, hello world service * @@ -148,6 +188,44 @@ void testBasicPutSpringDefinitionScanningAlt() throws IOException, JSONException assertJsonEquals("resource.testBasicSpringPutDefinitionScanning.json", result); } + /** + * This test a basic, no OpenApi annotations, hello world service + * + * @throws IOException + * @throws JSONException + */ + @Test + void testBasicPutSpringDefinitionScanningWithServletContextJakarta() throws IOException, JSONException { + Index i = indexOf( + test.io.smallrye.openapi.runtime.scanner.resources.jakarta.GreetingPutControllerWithServletContext.class, + Greeting.class); + OpenApiAnnotationScanner scanner = new OpenApiAnnotationScanner(emptyConfig(), i); + + OpenAPI result = scanner.scan(); + + printToConsole(result); + assertJsonEquals("resource.testBasicSpringPutDefinitionScanning.json", result); + } + + /** + * This test a basic, no OpenApi annotations, hello world service + * + * @throws IOException + * @throws JSONException + */ + @Test + void testBasicPutSpringDefinitionScanningWithServletContextJavax() throws IOException, JSONException { + Index i = indexOf( + test.io.smallrye.openapi.runtime.scanner.resources.javax.GreetingPutControllerWithServletContext.class, + Greeting.class); + OpenApiAnnotationScanner scanner = new OpenApiAnnotationScanner(emptyConfig(), i); + + OpenAPI result = scanner.scan(); + + printToConsole(result); + assertJsonEquals("resource.testBasicSpringPutDefinitionScanning.json", result); + } + /** * This test a basic, no OpenApi annotations, hello world service * diff --git a/extension-spring/src/test/java/test/io/smallrye/openapi/runtime/scanner/resources/jakarta/GreetingPostControllerWithServletContext.java b/extension-spring/src/test/java/test/io/smallrye/openapi/runtime/scanner/resources/jakarta/GreetingPostControllerWithServletContext.java new file mode 100644 index 000000000..93e619af9 --- /dev/null +++ b/extension-spring/src/test/java/test/io/smallrye/openapi/runtime/scanner/resources/jakarta/GreetingPostControllerWithServletContext.java @@ -0,0 +1,49 @@ +package test.io.smallrye.openapi.runtime.scanner.resources.jakarta; + +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; + +import org.eclipse.microprofile.openapi.annotations.media.Content; +import org.eclipse.microprofile.openapi.annotations.media.Schema; +import org.eclipse.microprofile.openapi.annotations.responses.APIResponse; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import test.io.smallrye.openapi.runtime.scanner.entities.Greeting; + +/** + * Spring. + * Some basic test, comparing with what we get in the JAX-RS version. + * See the GreetingPostResource in the JAX-RS test + * + * @author Phillip Kruger (phillip.kruger@redhat.com) + */ +@RestController +@RequestMapping(value = "/greeting", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) +public class GreetingPostControllerWithServletContext { + + // 1) Basic path var test + @PostMapping("/greet") + public Greeting greet(HttpServletRequest request, HttpServletResponse response, @RequestBody Greeting greeting) { + return greeting; + } + + // 2) ResponseEntity without a type specified + @PostMapping("/greetWithResponse") + @APIResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(ref = "#/components/schemas/Greeting"))) + public ResponseEntity greetWithResponse(@RequestBody Greeting greeting, HttpServletRequest request, + HttpServletResponse response) { + return ResponseEntity.ok(greeting); + } + + // 3) ResponseEntity with a type specified (No JaxRS comparison) + @PostMapping("/greetWithResponseTyped") + public ResponseEntity greetWithResponseTyped(HttpSession session, @RequestBody Greeting greeting) { + return ResponseEntity.ok(greeting); + } +} diff --git a/extension-spring/src/test/java/test/io/smallrye/openapi/runtime/scanner/resources/jakarta/GreetingPutControllerWithServletContext.java b/extension-spring/src/test/java/test/io/smallrye/openapi/runtime/scanner/resources/jakarta/GreetingPutControllerWithServletContext.java new file mode 100644 index 000000000..203f3840f --- /dev/null +++ b/extension-spring/src/test/java/test/io/smallrye/openapi/runtime/scanner/resources/jakarta/GreetingPutControllerWithServletContext.java @@ -0,0 +1,52 @@ +package test.io.smallrye.openapi.runtime.scanner.resources.jakarta; + +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; + +import org.eclipse.microprofile.openapi.annotations.media.Content; +import org.eclipse.microprofile.openapi.annotations.media.Schema; +import org.eclipse.microprofile.openapi.annotations.responses.APIResponse; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import test.io.smallrye.openapi.runtime.scanner.entities.Greeting; + +/** + * Spring. + * Some basic test, comparing with what we get in the JAX-RS version. + * See the GreetingPutResource in the JAX-RS test + * + * @author Phillip Kruger (phillip.kruger@redhat.com) + */ +@RestController +@RequestMapping(value = "/greeting", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) +public class GreetingPutControllerWithServletContext { + + // 1) Basic path var test + @PutMapping("/greet/{id}") + public Greeting greet(HttpServletRequest request, HttpServletResponse response, @RequestBody Greeting greeting, + @PathVariable(name = "id") String id) { + return greeting; + } + + // 2) ResponseEntity without a type specified + @PutMapping("/greetWithResponse/{id}") + @APIResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(ref = "#/components/schemas/Greeting"))) + public ResponseEntity greetWithResponse(@RequestBody Greeting greeting, @PathVariable(name = "id") String id, + HttpServletRequest request, HttpServletResponse response) { + return ResponseEntity.ok(greeting); + } + + // 3) ResponseEntity with a type specified (No JaxRS comparison) + @PutMapping("/greetWithResponseTyped/{id}") + public ResponseEntity greetWithResponseTyped(HttpSession session, @RequestBody Greeting greeting, + @PathVariable(name = "id") String id) { + return ResponseEntity.ok(greeting); + } +} diff --git a/extension-spring/src/test/java/test/io/smallrye/openapi/runtime/scanner/resources/javax/GreetingPostControllerWithServletContext.java b/extension-spring/src/test/java/test/io/smallrye/openapi/runtime/scanner/resources/javax/GreetingPostControllerWithServletContext.java new file mode 100644 index 000000000..75e245631 --- /dev/null +++ b/extension-spring/src/test/java/test/io/smallrye/openapi/runtime/scanner/resources/javax/GreetingPostControllerWithServletContext.java @@ -0,0 +1,49 @@ +package test.io.smallrye.openapi.runtime.scanner.resources.javax; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +import org.eclipse.microprofile.openapi.annotations.media.Content; +import org.eclipse.microprofile.openapi.annotations.media.Schema; +import org.eclipse.microprofile.openapi.annotations.responses.APIResponse; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import test.io.smallrye.openapi.runtime.scanner.entities.Greeting; + +/** + * Spring. + * Some basic test, comparing with what we get in the JAX-RS version. + * See the GreetingPostResource in the JAX-RS test + * + * @author Phillip Kruger (phillip.kruger@redhat.com) + */ +@RestController +@RequestMapping(value = "/greeting", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) +public class GreetingPostControllerWithServletContext { + + // 1) Basic path var test + @PostMapping("/greet") + public Greeting greet(HttpServletRequest request, HttpServletResponse response, @RequestBody Greeting greeting) { + return greeting; + } + + // 2) ResponseEntity without a type specified + @PostMapping("/greetWithResponse") + @APIResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(ref = "#/components/schemas/Greeting"))) + public ResponseEntity greetWithResponse(@RequestBody Greeting greeting, HttpServletRequest request, + HttpServletResponse response) { + return ResponseEntity.ok(greeting); + } + + // 3) ResponseEntity with a type specified (No JaxRS comparison) + @PostMapping("/greetWithResponseTyped") + public ResponseEntity greetWithResponseTyped(HttpSession session, @RequestBody Greeting greeting) { + return ResponseEntity.ok(greeting); + } +} diff --git a/extension-spring/src/test/java/test/io/smallrye/openapi/runtime/scanner/resources/javax/GreetingPutControllerWithServletContext.java b/extension-spring/src/test/java/test/io/smallrye/openapi/runtime/scanner/resources/javax/GreetingPutControllerWithServletContext.java new file mode 100644 index 000000000..3a1af52ae --- /dev/null +++ b/extension-spring/src/test/java/test/io/smallrye/openapi/runtime/scanner/resources/javax/GreetingPutControllerWithServletContext.java @@ -0,0 +1,52 @@ +package test.io.smallrye.openapi.runtime.scanner.resources.javax; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +import org.eclipse.microprofile.openapi.annotations.media.Content; +import org.eclipse.microprofile.openapi.annotations.media.Schema; +import org.eclipse.microprofile.openapi.annotations.responses.APIResponse; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import test.io.smallrye.openapi.runtime.scanner.entities.Greeting; + +/** + * Spring. + * Some basic test, comparing with what we get in the JAX-RS version. + * See the GreetingPutResource in the JAX-RS test + * + * @author Phillip Kruger (phillip.kruger@redhat.com) + */ +@RestController +@RequestMapping(value = "/greeting", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) +public class GreetingPutControllerWithServletContext { + + // 1) Basic path var test + @PutMapping("/greet/{id}") + public Greeting greet(HttpServletRequest request, HttpServletResponse response, @RequestBody Greeting greeting, + @PathVariable(name = "id") String id) { + return greeting; + } + + // 2) ResponseEntity without a type specified + @PutMapping("/greetWithResponse/{id}") + @APIResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(ref = "#/components/schemas/Greeting"))) + public ResponseEntity greetWithResponse(@RequestBody Greeting greeting, @PathVariable(name = "id") String id, + HttpServletRequest request, HttpServletResponse response) { + return ResponseEntity.ok(greeting); + } + + // 3) ResponseEntity with a type specified (No JaxRS comparison) + @PutMapping("/greetWithResponseTyped/{id}") + public ResponseEntity greetWithResponseTyped(HttpSession session, @RequestBody Greeting greeting, + @PathVariable(name = "id") String id) { + return ResponseEntity.ok(greeting); + } +} diff --git a/pom.xml b/pom.xml index 22a51f880..81ac916dc 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ io.smallrye smallrye-parent - 43 + 44 smallrye-open-api-parent @@ -17,21 +17,21 @@ http://smallrye.io - 3.5.0 - 2.17.0 + 3.6.0 + 2.17.1 3.0.3 - 3.1.7 - 3.8.1 + 3.2.0 + 3.8.2 4.0-SNAPSHOT 1.3 2.0.0.0 1.5.1 3.3.1 1.15.0 - 3.10.0 + 3.11.1 7.10.2 2.0.0.Final - 11.0.20 + 11.0.21 6.2.3.Final diff --git a/testsuite/data/pom.xml b/testsuite/data/pom.xml index 33593ab61..f637c58bc 100644 --- a/testsuite/data/pom.xml +++ b/testsuite/data/pom.xml @@ -4,7 +4,7 @@ io.smallrye smallrye-build-parent - 43 + 44 @@ -14,14 +14,14 @@ 4.0-SNAPSHOT - 1.9.23 + 2.0.0 17 ${java.version} ${java.version} ${java.version} quarkus-bom io.quarkus - 3.10.0 + 3.11.1 uber-jar false @@ -155,7 +155,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.5.0 + 3.6.0 add-source @@ -240,7 +240,7 @@ org.codehaus.mojo exec-maven-plugin - 3.2.0 + 3.3.0 diff --git a/tools/gradle-plugin/build.gradle b/tools/gradle-plugin/build.gradle index e43d6f588..91e9cee45 100644 --- a/tools/gradle-plugin/build.gradle +++ b/tools/gradle-plugin/build.gradle @@ -37,7 +37,7 @@ dependencies { testImplementation("org.junit.jupiter:junit-jupiter:${versionJunit5}") testImplementation(gradleTestKit()) - testImplementation("org.assertj:assertj-core:3.25.3") + testImplementation("org.assertj:assertj-core:3.26.0") testImplementation("com.fasterxml.jackson.core:jackson-databind:${versionJackson}") } diff --git a/tools/maven-plugin/pom.xml b/tools/maven-plugin/pom.xml index 2e738d177..1e3cbc370 100644 --- a/tools/maven-plugin/pom.xml +++ b/tools/maven-plugin/pom.xml @@ -16,9 +16,9 @@ true 0.13.1 - 3.9.6 - 3.12.0 - 3.9.6 + 3.9.7 + 3.13.1 + 3.9.7 @@ -89,7 +89,7 @@ org.apache.maven.plugins maven-plugin-plugin - 3.12.0 + 3.13.1 smallrye-open-api diff --git a/ui/open-api-ui/pom.xml b/ui/open-api-ui/pom.xml index 60f989800..1f0d221a3 100644 --- a/ui/open-api-ui/pom.xml +++ b/ui/open-api-ui/pom.xml @@ -13,7 +13,7 @@ SmallRye: OpenAPI UI - 5.17.2 + 5.17.14 3.0.1 openapi-ui true