Skip to content

Commit

Permalink
Merge pull request #19475 from phillip-kruger/openapi-restpath
Browse files Browse the repository at this point in the history
OpenAPI: Added support for `quarkus.resteasy-reactive.path`
  • Loading branch information
stuartwdouglas authored Aug 19, 2021
2 parents 1aa583e + f319f7f commit af843a0
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 af843a0

Please sign in to comment.