new OpenAPI3RouterFactory()
Interface for OpenAPI3RouterFactory.
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 . Deprecated in favour of
operation id
Parameters:
| Name | Type | Description |
|---|---|---|
method |
Object | |
path |
string | |
failureHandler |
function |
Returns:
- Type
- RouterFactory
addFailureHandlerByOperationId(operationId, failureHandler) → {OpenAPI3RouterFactory}
Add a failure handler by operation_id field in Operation object
Parameters:
| Name | Type | Description |
|---|---|---|
operationId |
string | |
failureHandler |
function |
Returns:
this factory
- Type
- OpenAPI3RouterFactory
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 . Deprecated in favour of
operation id
Parameters:
| Name | Type | Description |
|---|---|---|
method |
Object | |
path |
string | |
handler |
function |
Returns:
- Type
- RouterFactory
addHandlerByOperationId(operationId, handler) → {OpenAPI3RouterFactory}
Add an handler by operation_id field in Operation object
Parameters:
| Name | Type | Description |
|---|---|---|
operationId |
string | |
handler |
function |
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 |
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 |
Returns:
this factory
- Type
- OpenAPI3RouterFactory
enableValidationFailureHandler(enable) → {RouterFactory}
Deprecated. Instantiate
and load it using
Parameters:
| Name | Type | Description |
|---|---|---|
enable |
boolean |
Returns:
- Type
- RouterFactory
getOptions() → {Object}
Get options of router factory. For more info
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.
Note: Router is constructed in this function, so it will be respected the path definition ordering.
Returns:
- Type
- Router
mountOperationsWithoutHandlers(enable) → {RouterFactory}
Deprecated. Instantiate
and load it using
Parameters:
| Name | Type | Description |
|---|---|---|
enable |
boolean |
Returns:
- Type
- RouterFactory
setOptions(options) → {RouterFactory}
Override options
Parameters:
| Name | Type | Description |
|---|---|---|
options |
Object |
Returns:
- Type
- RouterFactory
setValidationFailureHandler(handler) → {RouterFactory}
Deprecated. Instantiate
and load it using
Parameters:
| Name | Type | Description |
|---|---|---|
handler |
function |
Returns:
- Type
- RouterFactory