vertx / io.vertx.rxjava.ext.web.api.contract.openapi3 / OpenAPI3RouterFactory

# OpenAPI3RouterFactory

`open class OpenAPI3RouterFactory : RouterFactory<OpenAPI>`

Interface for OpenAPI3RouterFactory. To add an handler, use `io.vertx.rxjava.ext.web.api.contract.openapi3.OpenAPI3RouterFactory#addHandlerByOperationId`, in this class is better than generic If you want to use 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(); } }); }

NOTE: This class has been automatically generated from the io.vertx.ext.web.api.contract.openapi3.OpenAPI3RouterFactory non RX-ified interface using Vert.x codegen.

### Constructors

<init> | `OpenAPI3RouterFactory(delegate: OpenAPI3RouterFactory)`

### Properties

__TYPE_ARG | `static val __TYPE_ARG: TypeArg<OpenAPI3RouterFactory>`

### Functions

addFailureHandler | `open fun addFailureHandler(method: HttpMethod, path: String, failureHandler: Handler<RoutingContext>): RouterFactory<Any>` Add a failure handler to a path with a method. If combination path/method is not available in specification, it will throw a . Deprecated in favour of operation id
addFailureHandlerByOperationId | `open fun addFailureHandlerByOperationId(operationId: String, failureHandler: Handler<RoutingContext>): OpenAPI3RouterFactory` Add a failure handler by operation_id field in Operation object
addHandler | `open fun addHandler(method: HttpMethod, path: String, handler: Handler<RoutingContext>): RouterFactory<Any>` Add an handler to a path with a method. If combination path/method is not available in specification, it will throw a . Deprecated in favour of operation id
addHandlerByOperationId | `open fun addHandlerByOperationId(operationId: String, handler: Handler<RoutingContext>): OpenAPI3RouterFactory` Add an handler by operation_id field in Operation object
addSecurityHandler | `open fun addSecurityHandler(securitySchemaName: String, handler: Handler<RoutingContext>): RouterFactory<Any>` Mount to paths that have to follow a security schema a security handler
addSecuritySchemaScopeValidator | `open fun addSecuritySchemaScopeValidator(securitySchemaName: String, scopeName: String, handler: Handler<RoutingContext>): OpenAPI3RouterFactory` Add a particular scope validator. The main security schema will not be called if a specific scope validator is configured
create | `open static fun create(vertx: Vertx, url: String, handler: Handler<AsyncResult<OpenAPI3RouterFactory>>): Unit` Create a new OpenAPI3RouterFactory
createRouterFactoryFromFile | `open static fun createRouterFactoryFromFile(vertx: Vertx, url: String, handler: Handler<AsyncResult<OpenAPI3RouterFactory>>): Unit`
createRouterFactoryFromURL | `open static fun createRouterFactoryFromURL(vertx: Vertx, url: String, handler: Handler<AsyncResult<OpenAPI3RouterFactory>>): Unit`
enableValidationFailureHandler | `open fun enableValidationFailureHandler(enable: Boolean): RouterFactory<Any>` Deprecated. Instantiate and load it using
equals | `open fun equals(other: Any?): Boolean`
getDelegate | `open fun getDelegate(): OpenAPI3RouterFactory`
getOptions | `open fun getOptions(): RouterFactoryOptions` Get options of router factory. For more info
getRouter | `open fun getRouter(): Router` Construct a new router based on spec. It will fail if you are trying to mount a spec with security schemes without assigned handlers Note: Router is constructed in this function, so it will be respected the path definition ordering.
hashCode | `open fun hashCode(): Int`
mountOperationsWithoutHandlers | `open fun mountOperationsWithoutHandlers(enable: Boolean): RouterFactory<Any>` Deprecated. Instantiate and load it using
newInstance | `open static fun newInstance(arg: OpenAPI3RouterFactory): OpenAPI3RouterFactory`
rxCreate | `open static fun rxCreate(vertx: Vertx, url: String): Single<OpenAPI3RouterFactory>` Create a new OpenAPI3RouterFactory
rxCreateRouterFactoryFromFile | `open static fun rxCreateRouterFactoryFromFile(vertx: Vertx, url: String): Single<OpenAPI3RouterFactory>`
rxCreateRouterFactoryFromURL | `open static fun rxCreateRouterFactoryFromURL(vertx: Vertx, url: String): Single<OpenAPI3RouterFactory>`
setOptions | `open fun setOptions(options: RouterFactoryOptions): RouterFactory<Any>` Override options
setValidationFailureHandler | `open fun setValidationFailureHandler(handler: Handler<RoutingContext>): RouterFactory<Any>` Deprecated. Instantiate and load it using
toString | `open fun toString(): String`