Class: OpenAPI3RouterFactory

vertx-web-api-contract-js/open_api3_router_factory~ OpenAPI3RouterFactory

new OpenAPI3RouterFactory()

Interface for OpenAPI3RouterFactory.
Source:

Methods

addFailureHandlerByOperationId(operationId, failureHandler) → {OpenAPI3RouterFactory}

Add a failure handler by operation_id field in Operation object
Parameters:
Name Type Description
operationId string
failureHandler function
Source:
Returns:
this factory
Type
OpenAPI3RouterFactory

addGlobalHandler(globalHandler) → {RouterFactory}

Add global handler to be applied prior to Router being generated.
Please note that you should not add a body handler inside that list. If you want to modify the body handler, please use
Parameters:
Name Type Description
globalHandler function
Source:
Returns:
this object
Type
RouterFactory

addHandlerByOperationId(operationId, handler) → {OpenAPI3RouterFactory}

Add an handler by operation_id field in Operation object
Parameters:
Name Type Description
operationId string
handler function
Source:
Returns:
this factory
Type
OpenAPI3RouterFactory

addSecurityHandler(securitySchemaName, handler) → {RouterFactory}

Mount to paths that have to follow a security schema a security handler
Parameters:
Name Type Description
securitySchemaName string
handler function
Source:
Returns:
Type
RouterFactory

addSecuritySchemaScopeValidator(securitySchemaName, scopeName, handler) → {OpenAPI3RouterFactory}

Add a particular scope validator. The main security schema will not be called if a specific scope validator is configured
Parameters:
Name Type Description
securitySchemaName string
scopeName string
handler function
Source:
Returns:
this factory
Type
OpenAPI3RouterFactory

getOptions() → {Object}

Get options of router factory. For more info
Source:
Returns:
Type
Object

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.
Source:
Returns:
Type
Router

getValidationFailureHandler() → {function}

Source:
Returns:
Type
function

mountOperationToEventBus(operationId, address) → {OpenAPI3RouterFactory}

Specify to route an incoming request for specified operation id to a Web Api Service mounted at the specified address on event bus. Please give a look at vertx-web-api-service documentation for more informations
Parameters:
Name Type Description
operationId string
address string
Source:
Returns:
this factory
Type
OpenAPI3RouterFactory

mountServiceFromTag(tag, address) → {OpenAPI3RouterFactory}

Specify to route an incoming request for all operations that contains the specified tag to a Web Api Service mounted at the specified address on event bus. The request is handled by the method that matches the operation id. Please give a look at vertx-web-api-service documentation for more informations
Parameters:
Name Type Description
tag string
address string
Source:
Returns:
this factory
Type
OpenAPI3RouterFactory

mountServicesFromExtensions() → {OpenAPI3RouterFactory}

Introspect the OpenAPI spec to mount handlers for all operations that specifies a x-vertx-event-bus annotation. Please give a look at vertx-web-api-service documentation for more informations
Source:
Returns:
this factory
Type
OpenAPI3RouterFactory

setBodyHandler(bodyHandler) → {RouterFactory}

Supply your own BodyHandler if you would like to control body limit, uploads directory and deletion of uploaded files
Parameters:
Name Type Description
bodyHandler BodyHandler
Source:
Returns:
self
Type
RouterFactory

setExtraOperationContextPayloadMapper(extraOperationContextPayloadMapper) → {RouterFactory}

When set, this function is called while creating the payload of OperationRequest
Parameters:
Name Type Description
extraOperationContextPayloadMapper function
Source:
Returns:
Type
RouterFactory

setNotImplementedFailureHandler(notImplementedFailureHandler) → {RouterFactory}

Set not implemented failure handler. It's called when you don't define an handler for a specific operation. You can enable/disable this feature from
Parameters:
Name Type Description
notImplementedFailureHandler function
Source:
Returns:
this object
Type
RouterFactory

setOptions(options) → {RouterFactory}

Set options of router factory. For more info
Parameters:
Name Type Description
options Object
Source:
Returns:
Type
RouterFactory

setValidationFailureHandler(validationFailureHandler) → {RouterFactory}

Set default validation failure handler. You can enable/disable this feature from
Parameters:
Name Type Description
validationFailureHandler function
Source:
Returns:
this object
Type
RouterFactory