io.vertx.ext.web.api.contract.openapi3

## Interface OpenAPI3RouterFactory

- All Superinterfaces:
    DesignDrivenRouterFactory<io.swagger.oas.models.OpenAPI>

      public interface OpenAPI3RouterFactory
      extends DesignDrivenRouterFactory<io.swagger.oas.models.OpenAPI>

  Interface for OpenAPI3RouterFactory.
  To add an handler, use `addHandlerByOperationId(String, Handler)`, in this class is better than generic `DesignDrivenRouterFactory.addHandler(HttpMethod, String, Handler)`
  If you want to use `DesignDrivenRouterFactory.addHandler(HttpMethod, String, Handler)` remember that you have to pass path as declared in openapi specification Usage example:

       OpenAPI3RouterFactory.createRouterFactoryFromFile(vertx, "src/resources/spec.yaml", asyncResult -> {
        if (!asyncResult.succeeded()) {
           // IO failure or spec invalid
        } else {
           OpenAPI3RouterFactory routerFactory = asyncResult.result();
           routerFactory.addHandlerByOperationId("operation_id", routingContext -> {
              // Do something
           }, routingContext -> {
              // Do something with failure handler
           });
           Router router = routerFactory.getRouter();
        }
       });

  Author:
    Francesco Guardiani @slinkydeveloper

- - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `OpenAPI3RouterFactory` | `addFailureHandlerByOperationId(String operationId, Handler<RoutingContext> failureHandler)` Add a failure handler by operation_id field in Operation object
    `OpenAPI3RouterFactory` | `addHandlerByOperationId(String operationId, Handler<RoutingContext> handler)` Add an handler by operation_id field in Operation object
    `OpenAPI3RouterFactory` | `addSecuritySchemaScopeValidator(String securitySchemaName, String scopeName, Handler<RoutingContext> handler)` Add a particular scope validator.
    `static void` | `createRouterFactoryFromFile(Vertx vertx, String filename, Handler<AsyncResult<OpenAPI3RouterFactory>> handler)` Create a new OpenAPI3RouterFactory from a filename
    `static void` | `createRouterFactoryFromURL(Vertx vertx, String url, Handler<AsyncResult<OpenAPI3RouterFactory>> handler)` Create a new OpenAPI3RouterFactory from an url

    - ### Methods inherited from interface io.vertx.ext.web.api.contract.DesignDrivenRouterFactory

      `addFailureHandler, addHandler, addSecurityHandler, enableValidationFailureHandler, getRouter, mountOperationsWithoutHandlers, setValidationFailureHandler`

- - ### Method Detail

    - #### addSecuritySchemaScopeValidator

          OpenAPI3RouterFactory addSecuritySchemaScopeValidator(String securitySchemaName,
                                                                String scopeName,
                                                                Handler<RoutingContext> handler)

      Add a particular scope validator. The main security schema will not be called if a specific scope validator is configured
      Parameters:
        `securitySchemaName` -
        `scopeName` -
        `handler` -
      Returns:

    - #### addHandlerByOperationId

          OpenAPI3RouterFactory addHandlerByOperationId(String operationId,
                                                        Handler<RoutingContext> handler)

      Add an handler by operation_id field in Operation object
      Parameters:
        `operationId` -
        `handler` -
      Returns:

    - #### addFailureHandlerByOperationId

          OpenAPI3RouterFactory addFailureHandlerByOperationId(String operationId,
                                                               Handler<RoutingContext> failureHandler)

      Add a failure handler by operation_id field in Operation object
      Parameters:
        `operationId` -
        `failureHandler` -
      Returns:

    - #### createRouterFactoryFromFile

          static void createRouterFactoryFromFile(Vertx vertx,
                                                  String filename,
                                                  Handler<AsyncResult<OpenAPI3RouterFactory>> handler)

      Create a new OpenAPI3RouterFactory from a filename
      Parameters:
        `vertx` -
        `filename` -
        `handler` - When specification is loaded, this handler will be called with AsyncResult

    - #### createRouterFactoryFromURL

          static void createRouterFactoryFromURL(Vertx vertx,
                                                 String url,
                                                 Handler<AsyncResult<OpenAPI3RouterFactory>> handler)

      Create a new OpenAPI3RouterFactory from an url
      Parameters:
        `vertx` -
        `url` -
        `handler` - When specification is loaded, this handler will be called with AsyncResult

Copyright © 2017. All rights reserved.