Package org.apache.cxf.jaxrs.swagger.ui
Class SwaggerUiService
- java.lang.Object
-
- org.apache.cxf.jaxrs.swagger.ui.SwaggerUiService
-
@Path("api-docs") public class SwaggerUiService extends Object
-
-
Constructor Summary
Constructors Constructor Description SwaggerUiService(SwaggerUiResourceLocator locator, Map<String,String> mediaTypes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.ws.rs.core.ResponsegetResource(javax.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 Detail
-
SwaggerUiService
public SwaggerUiService(SwaggerUiResourceLocator locator, Map<String,String> mediaTypes)
-
-
Method Detail
-
setConfig
public void setConfig(SwaggerUiConfig config)
-
getResource
@GET @Path("{resource:.*}") public javax.ws.rs.core.Response getResource(@Context javax.ws.rs.core.UriInfo uriInfo, @PathParam("resource") String resourcePath)
-
replaceUrl
protected String replaceUrl(String index, String replacement)
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
-
-