new OpenAPI3RouterFactory()
Interface for OpenAPI3RouterFactory.
Methods
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
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
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 |
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 |
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
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
getValidationFailureHandler() → {function}
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 |
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 |
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
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 |
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 |
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 |
Returns:
this object
- Type
- RouterFactory
setOptions(options) → {RouterFactory}
Set options of router factory. For more info
Parameters:
| Name | Type | Description |
|---|---|---|
options |
Object |
Returns:
- Type
- RouterFactory
setValidationFailureHandler(validationFailureHandler) → {RouterFactory}
Set default validation failure handler. You can enable/disable this feature from
Parameters:
| Name | Type | Description |
|---|---|---|
validationFailureHandler |
function |
Returns:
this object
- Type
- RouterFactory