From f319f7fc4cad7f6d699e808dc9ad42a91d6a42ef Mon Sep 17 00:00:00 2001 From: Phillip Kruger Date: Wed, 18 Aug 2021 11:32:55 +0200 Subject: [PATCH] OpenAPI: Added support for `quarkus.resteasy-reactive.path` Signed-off-by:Phillip Kruger --- .../deployment/SmallRyeOpenApiProcessor.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/extensions/smallrye-openapi/deployment/src/main/java/io/quarkus/smallrye/openapi/deployment/SmallRyeOpenApiProcessor.java b/extensions/smallrye-openapi/deployment/src/main/java/io/quarkus/smallrye/openapi/deployment/SmallRyeOpenApiProcessor.java index 2a96133a559a4..276e9e3619c2e 100644 --- a/extensions/smallrye-openapi/deployment/src/main/java/io/quarkus/smallrye/openapi/deployment/SmallRyeOpenApiProcessor.java +++ b/extensions/smallrye-openapi/deployment/src/main/java/io/quarkus/smallrye/openapi/deployment/SmallRyeOpenApiProcessor.java @@ -496,17 +496,22 @@ private OpenAPI generateAnnotationModel(IndexView indexView, Capabilities capabi OpenApiConfig openApiConfig = new OpenApiConfigImpl(config); List extensions = new ArrayList<>(); + // Add the RESTEasy extension if the capability is present + String defaultPath = httpRootPathBuildItem.getRootPath(); if (capabilities.isPresent(Capability.RESTEASY)) { extensions.add(new RESTEasyExtension(indexView)); + if (resteasyJaxrsConfig.isPresent()) { + defaultPath = resteasyJaxrsConfig.get().getRootPath(); + } + } else if (capabilities.isPresent(Capability.RESTEASY_REACTIVE)) { + extensions.add(new RESTEasyExtension(indexView)); + Optional maybePath = config.getOptionalValue("quarkus.resteasy-reactive.path", String.class); + if (maybePath.isPresent()) { + defaultPath = maybePath.get(); + } } - String defaultPath; - if (resteasyJaxrsConfig.isPresent()) { - defaultPath = resteasyJaxrsConfig.get().getRootPath(); - } else { - defaultPath = httpRootPathBuildItem.getRootPath(); - } if (defaultPath != null && !"/".equals(defaultPath)) { extensions.add(new CustomPathExtension(defaultPath)); }