Skip to content

Commit

Permalink
OpenAPI: Added support for quarkus.resteasy-reactive.path
Browse files Browse the repository at this point in the history
Signed-off-by:Phillip Kruger <[email protected]>
  • Loading branch information
phillip-kruger committed Aug 18, 2021
1 parent 77d652e commit f319f7f
Showing 1 changed file with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -496,17 +496,22 @@ private OpenAPI generateAnnotationModel(IndexView indexView, Capabilities capabi
OpenApiConfig openApiConfig = new OpenApiConfigImpl(config);

List<AnnotationScannerExtension> 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<String> 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));
}
Expand Down

0 comments on commit f319f7f

Please sign in to comment.