Package org.apache.camel.openapi
Class RestOpenApiSupport
java.lang.Object
org.apache.camel.openapi.RestOpenApiSupport
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected RestDefinitionsResolver
createJmxRestDefinitionsResolver
(org.apache.camel.CamelContext camelContext) static String
getBasePathFromOasDocument
(io.swagger.v3.oas.models.OpenAPI openapi) static <T> T
getFromOpenAPI
(io.swagger.v3.oas.models.OpenAPI openApi, BeanConfig config, Class<T> type, boolean json) static String
getHostFromOasDocument
(io.swagger.v3.oas.models.OpenAPI openapi) static String
getJsonFromOpenAPIAsString
(io.swagger.v3.oas.models.OpenAPI openApi, BeanConfig config) List
<org.apache.camel.model.rest.RestDefinition> getRestDefinitions
(org.apache.camel.CamelContext camelContext) List
<org.apache.camel.model.rest.RestDefinition> getRestDefinitions
(org.apache.camel.CamelContext camelContext, String camelId) void
initOpenApi
(BeanConfig openApiConfig, Map<String, Object> config) static String
parseVariables
(String url, io.swagger.v3.oas.models.servers.Server server) 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) void
setupXForwardHeaders
(RestApiResponseAdapter response, org.apache.camel.Exchange exchange)
-
Field Details
-
DEFAULT_DATE_FORMAT
-
-
Constructor Details
-
RestOpenApiSupport
public RestOpenApiSupport()
-
-
Method Details
-
getHostFromOasDocument
-
getBasePathFromOasDocument
-
parseVariables
-
initOpenApi
-
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)
-