Class RestOpenApiSupport

java.lang.Object
org.apache.camel.openapi.RestOpenApiSupport

public class RestOpenApiSupport extends Object
A support class for that allows SPI to plugin and offer OpenApi API service listings as part of the Camel component. This allows rest-dsl components such as servlet/jetty/netty-http to offer OpenApi API listings with minimal effort.
  • Field Details

    • DEFAULT_DATE_FORMAT

      public static DateFormat DEFAULT_DATE_FORMAT
  • Constructor Details

    • RestOpenApiSupport

      public RestOpenApiSupport()
  • Method Details

    • getHostFromOasDocument

      public static String getHostFromOasDocument(io.swagger.v3.oas.models.OpenAPI openapi)
    • getBasePathFromOasDocument

      public static String getBasePathFromOasDocument(io.swagger.v3.oas.models.OpenAPI openapi)
    • parseVariables

      public static String parseVariables(String url, io.swagger.v3.oas.models.servers.Server server)
    • initOpenApi

      public void initOpenApi(BeanConfig openApiConfig, Map<String,Object> config)
    • getRestDefinitions

      public List<org.apache.camel.model.rest.RestDefinition> getRestDefinitions(org.apache.camel.CamelContext camelContext) throws Exception
      Throws:
      Exception
    • getRestDefinitions

      public List<org.apache.camel.model.rest.RestDefinition> getRestDefinitions(org.apache.camel.CamelContext camelContext, String camelId) throws Exception
      Throws:
      Exception
    • createJmxRestDefinitionsResolver

      protected RestDefinitionsResolver createJmxRestDefinitionsResolver(org.apache.camel.CamelContext camelContext)
    • setupXForwardHeaders

      public void setupXForwardHeaders(RestApiResponseAdapter response, org.apache.camel.Exchange exchange)
    • renderResourceListing

      public void renderResourceListing(org.apache.camel.CamelContext camelContext, RestApiResponseAdapter response, BeanConfig openApiConfig, boolean json, org.apache.camel.spi.ClassResolver classResolver, org.apache.camel.spi.RestConfiguration configuration) throws Exception
      Throws:
      Exception
    • getJsonFromOpenAPIAsString

      public static String getJsonFromOpenAPIAsString(io.swagger.v3.oas.models.OpenAPI openApi, BeanConfig config)
    • getFromOpenAPI

      public static <T> T getFromOpenAPI(io.swagger.v3.oas.models.OpenAPI openApi, BeanConfig config, Class<T> type, boolean json)