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 Type
    Method
    Description
    Whether 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.
    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
    boolean
    processApiSpecification(String specificationUri, org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback)
    Strategy for processing the OpenAPI specification (to return the contract)
    void
    setMissingOperation(String missingOperation)
    Whether the consumer should fail,ignore or return a dummy response for OpenAPI operations that are not mapped to a corresponding route.
    void
    setMockIncludePattern(String mockIncludePattern)
    Used for inclusive filtering of mock data from directories.
    default void
    validateOpenApi(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

      void setMissingOperation(String missingOperation)
      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

      void setMockIncludePattern(String mockIncludePattern)
      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 specification
      basePath - base path
      platformHttpConsumer - 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 specification
      operation - the rest operation
      verb - the HTTP verb (GET, POST etc.)
      path - the context-path
      binding - binding advice
      exchange - the exchange
      callback - 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 exchange
      callback - 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