Interface OpenAPIRouterHandler

All Superinterfaces:
Handler<RoutingContext>

public interface OpenAPIRouterHandler extends Handler<RoutingContext>
  • Field Details

  • Method Details

    • create

      static OpenAPIRouterHandler create(Vertx vertx, Operation operation, ResponseValidator validator)
      Creates a new OpenAPIRouterHandler to forward requests from OpenAPI Router to Web API Service Proxies. In order to automatically parse the destination of the related Web API Service Proxy, the OpenAPI Operation must be extended with the "x-vertx-event-bus" property.
      {
        ...
        "operationId": "myOperation",
        "x-vertx-event-bus" : "myEventbusAddress"
        ...
      }
      
      {
       ...
       "operationId": "myOperation",
       "x-vertx-event-bus" : {
         "address" : "myEventbusAddress"
       }
       ...
       }
      
      {
       ...
       "operationId": "myOperation",
       "x-vertx-event-bus" : {
         "address" : "myEventbusAddress",
         "method" : "myMethod"
       }
       ...
       }
      
      Parameters:
      vertx - The related Vert.x instance to access the Eventbus
      operation - The related OpenAPI operation with the "x-vertx-event-bus" extension
      validator - The ResponseValidator to automatically validate the response received by the Web API Service Proxy
      Returns:
      a new OpenAPIRouterHandler
    • create

      static OpenAPIRouterHandler create(Vertx vertx, Operation operation, DeliveryOptions deliveryOptions, BiFunction<Operation, RoutingContext, JsonObject> extraPayloadMapper, ResponseValidator validator)
      Parameters:
      vertx - The related Vert.x instance to access the Eventbus
      operation - The related OpenAPI operation with the "x-vertx-event-bus" extension
      deliveryOptions - The DeliveryOptions which will be used by this handler for every eventbus request.
      extraPayloadMapper - A function to extract an extra payload from incoming requests.
      validator - The ResponseValidator to automatically validate the response received by the Web API Service Proxy
      Returns:
      a new OpenAPIRouterHandler