Package org.apache.cxf.jaxrs.swagger.ui
Class SwaggerUiService
java.lang.Object
org.apache.cxf.jaxrs.swagger.ui.SwaggerUiService
-
Constructor Summary
ConstructorsConstructorDescriptionSwaggerUiService(SwaggerUiResourceLocator locator, Map<String, String> mediaTypes) -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.ResponsegetResource(jakarta.ws.rs.core.UriInfo uriInfo, String resourcePath) protected StringreplaceUrl(String index, String replacement) Replaces the URL inside Swagger UI index.html file.voidsetConfig(SwaggerUiConfig config)
-
Constructor Details
-
SwaggerUiService
-
-
Method Details
-
setConfig
-
getResource
@GET @Path("{resource:.*}") public jakarta.ws.rs.core.Response getResource(@Context jakarta.ws.rs.core.UriInfo uriInfo, @PathParam("resource") String resourcePath) -
replaceUrl
Replaces the URL inside Swagger UI index.html file. The implementation does not attempt to read the file and parse it as valid HTML but uses straightforward approach by looking for the URL pattern of the SwaggerUIBundle initialization and replacing it.- Parameters:
index- index.html file contentreplacement- replacement URL- Returns:
- index.html file content with replaced URL
-