Class: RouterFactory

vertx-web-api-contract-js/router_factory~ RouterFactory

new RouterFactory()

Main interface for Design Driven Router factory
Source:

Methods

addFailureHandler(method, path, failureHandler) → {RouterFactory}

Add a failure handler to a path with a method. If combination path/method is not available in specification, it will throw a RouterFactoryException. Deprecated in favour of operation id
Parameters:
Name Type Description
method Object
path string
failureHandler function
Source:
Returns:
Type
RouterFactory

addHandler(method, path, handler) → {RouterFactory}

Add an handler to a path with a method. If combination path/method is not available in specification, it will throw a RouterFactoryException. Deprecated in favour of operation id
Parameters:
Name Type Description
method Object
path string
handler function
Source:
Returns:
Type
RouterFactory

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

enableValidationFailureHandler(enable) → {RouterFactory}

Deprecated. Instantiate RouterFactoryOptions and load it using RouterFactory#setOptions
Parameters:
Name Type Description
enable boolean
Source:
Returns:
Type
RouterFactory

getOptions() → {Object}

Get options of router factory. For more info RouterFactoryOptions
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

mountOperationsWithoutHandlers(enable) → {RouterFactory}

Deprecated. Instantiate RouterFactoryOptions and load it using RouterFactory#setOptions
Parameters:
Name Type Description
enable boolean
Source:
Returns:
Type
RouterFactory

setOptions(options) → {RouterFactory}

Override options
Parameters:
Name Type Description
options Object
Source:
Returns:
Type
RouterFactory

setValidationFailureHandler(handler) → {RouterFactory}

Deprecated. Instantiate RouterFactoryOptions and load it using RouterFactory#setOptions
Parameters:
Name Type Description
handler function
Source:
Returns:
Type
RouterFactory