Interface RestOpenapiProcessorStrategy
- All Known Implementing Classes:
DefaultRestOpenapiProcessorStrategy
public interface RestOpenapiProcessorStrategy
Strategy for processing the Rest DSL that services an OpenAPI spec.
-
Method Summary
Modifier and TypeMethodDescriptionWhether the consumer should fail,ignore or return a dummy response for OpenAPI operations that are not mapped to a corresponding route.Used for inclusive filtering of mock data from directories.booleanprocess(io.swagger.v3.oas.models.OpenAPI openAPI, io.swagger.v3.oas.models.Operation operation, String verb, String path, org.apache.camel.support.processor.RestBindingAdvice binding, org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback) Strategy for processing the Rest DSL operationbooleanprocessApiSpecification(String specificationUri, org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback) Strategy for processing the OpenAPI specification (to return the contract)voidsetMissingOperation(String missingOperation) Whether the consumer should fail,ignore or return a dummy response for OpenAPI operations that are not mapped to a corresponding route.voidsetMockIncludePattern(String mockIncludePattern) Used for inclusive filtering of mock data from directories.default voidvalidateOpenApi(io.swagger.v3.oas.models.OpenAPI openAPI, String basePath, org.apache.camel.component.platform.http.spi.PlatformHttpConsumerAware platformHttpConsumer) Validates the OpenAPI specification on startup
-
Method Details
-
setMissingOperation
Whether the consumer should fail,ignore or return a dummy response for OpenAPI operations that are not mapped to a corresponding route. -
getMissingOperation
String getMissingOperation()Whether the consumer should fail,ignore or return a dummy response for OpenAPI operations that are not mapped to a corresponding route. -
setMockIncludePattern
Used for inclusive filtering of mock data from directories. The pattern is using Ant-path style pattern. Multiple patterns can be specified separated by comma. -
getMockIncludePattern
String getMockIncludePattern()Used for inclusive filtering of mock data from directories. The pattern is using Ant-path style pattern. Multiple patterns can be specified separated by comma. -
validateOpenApi
default void validateOpenApi(io.swagger.v3.oas.models.OpenAPI openAPI, String basePath, org.apache.camel.component.platform.http.spi.PlatformHttpConsumerAware platformHttpConsumer) throws Exception Validates the OpenAPI specification on startup- Parameters:
openAPI- the openapi specificationbasePath- base pathplatformHttpConsumer- the platform http consumer- Throws:
Exception- is thrown if validation error on startup
-
process
boolean process(io.swagger.v3.oas.models.OpenAPI openAPI, io.swagger.v3.oas.models.Operation operation, String verb, String path, org.apache.camel.support.processor.RestBindingAdvice binding, org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback) Strategy for processing the Rest DSL operation- Parameters:
openAPI- the openapi specificationoperation- the rest operationverb- the HTTP verb (GET, POST etc.)path- the context-pathbinding- binding adviceexchange- the exchangecallback- the AsyncCallback will be invoked when the processing of the exchange is completed. If the exchange is completed synchronously, then the callback is also invoked synchronously. The callback should therefore be careful of starting recursive loop.- Returns:
- (doneSync) true to continue to execute synchronously, false to continue being executed asynchronously
-
processApiSpecification
boolean processApiSpecification(String specificationUri, org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback) Strategy for processing the OpenAPI specification (to return the contract)- Parameters:
exchange- the exchangecallback- the AsyncCallback will be invoked when the processing of the exchange is completed. If the exchange is completed synchronously, then the callback is also invoked synchronously. The callback should therefore be careful of starting recursive loop.- Returns:
- (doneSync) true to continue to execute synchronously, false to continue being executed asynchronously
-