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

## Interface OpenAPI3RouterFactory

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

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

  Interface for OpenAPI3RouterFactory.
  To add an handler, use `addHandlerByOperationId(String, Handler)`, in this class is better than generic `RouterFactory.addHandler(HttpMethod, String, Handler)`
  If you want to use `RouterFactory.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 Deprecated 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` | `create(Vertx vertx, String url, Handler<AsyncResult<OpenAPI3RouterFactory>> handler)` Create a new OpenAPI3RouterFactory
    `static void` | `createRouterFactoryFromFile(Vertx vertx, String url, Handler<AsyncResult<OpenAPI3RouterFactory>> handler)` Deprecated. use `create(Vertx, String, Handler)`
    `static void` | `createRouterFactoryFromURL(Vertx vertx, String url, Handler<AsyncResult<OpenAPI3RouterFactory>> handler)` Deprecated. use `create(Vertx, String, Handler)`

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

      `addFailureHandler, addHandler, addSecurityHandler, enableValidationFailureHandler, getOptions, getRouter, mountOperationsWithoutHandlers, setOptions, 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:
        this factory

    - #### addHandlerByOperationId

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

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

    - #### addFailureHandlerByOperationId

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

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

    - #### create

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

      Create a new OpenAPI3RouterFactory
      Parameters:
        `vertx` -
        `url` - location of your spec. It can be an absolute path, a local path or remote url (with HTTP protocol)
        `handler` - When specification is loaded, this handler will be called with AsyncResult

    - #### createRouterFactoryFromFile

          @Deprecated
          static void createRouterFactoryFromFile(Vertx vertx,
                                                              String url,
                                                              Handler<AsyncResult<OpenAPI3RouterFactory>> handler)

      Deprecated. use `create(Vertx, String, Handler)`
      Parameters:
        `vertx` -
        `url` -
        `handler` -

    - #### createRouterFactoryFromURL

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

      Deprecated. use `create(Vertx, String, Handler)`
      Parameters:
        `vertx` -
        `url` -
        `handler` -

Copyright © 2018 Eclipse. All rights reserved.