Class: DesignDrivenRouterFactory

vertx-web-api-contract-js/design_driven_router_factory~ DesignDrivenRouterFactory

new DesignDrivenRouterFactory()

Main interface for Design Driven Router factory
Source:

Methods

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

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

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

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

addSecurityHandler(securitySchemaName, handler) → {DesignDrivenRouterFactory}

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

enableValidationFailureHandler(enable) → {DesignDrivenRouterFactory}

Enable or disable validation failure handler. If you enable it, during router creation it will be mounted a built-in (or custom with function DesignDrivenRouterFactory#setValidationFailureHandler) ValidationException handler as a failure handler. If failure is different from ValidationException, it will be called the next failure handler.
Parameters:
Name Type Description
enable boolean
Source:
Returns:
Type
DesignDrivenRouterFactory

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) → {DesignDrivenRouterFactory}

Automatic mount handlers that return HTTP 501 status code for operations where you didn't specify an handler.
Parameters:
Name Type Description
enable boolean
Source:
Returns:
Type
DesignDrivenRouterFactory

setValidationFailureHandler(handler) → {DesignDrivenRouterFactory}

Set default validation failure handler. You can disable this feature from DesignDrivenRouterFactory#enableValidationFailureHandler
Parameters:
Name Type Description
handler function
Source:
Returns:
Type
DesignDrivenRouterFactory