Class SwaggerUiService

java.lang.Object
org.apache.cxf.jaxrs.swagger.ui.SwaggerUiService

@Path("api-docs") public class SwaggerUiService extends Object
  • Constructor Details

  • Method Details

    • setConfig

      public void setConfig(SwaggerUiConfig config)
    • getResource

      @GET @Path("{resource:.*}") public jakarta.ws.rs.core.Response getResource(@Context jakarta.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 content
      replacement - replacement URL
      Returns:
      index.html file content with replaced URL