# Class: OpenAPI3RouterFactory

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

#### new OpenAPI3RouterFactory()

Interface for OpenAPI3RouterFactory.

Source:
  - vertx-web-api-contract-js/open_api3_router_factory.js, line 33

### 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 |

Source:
  - vertx-web-api-contract-js/open_api3_router_factory.js, line 89

##### 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 |

Source:
  - vertx-web-api-contract-js/open_api3_router_factory.js, line 240

##### 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 |

Source:
  - vertx-web-api-contract-js/open_api3_router_factory.js, line 68

##### 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 |

Source:
  - vertx-web-api-contract-js/open_api3_router_factory.js, line 222

##### 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:
  - vertx-web-api-contract-js/open_api3_router_factory.js, line 47

##### 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:
  - vertx-web-api-contract-js/open_api3_router_factory.js, line 204

##### Returns:

this factory

Type
  OpenAPI3RouterFactory

#### enableValidationFailureHandler(enable) → {RouterFactory}

Deprecated. Instantiate and load it using

##### Parameters:

Name | Type | Description
--- | --- | ---
`enable` | boolean |

Source:
  - vertx-web-api-contract-js/open_api3_router_factory.js, line 154

##### Returns:

Type
  RouterFactory

#### getOptions() → {Object}

Get options of router factory. For more info

Source:
  - vertx-web-api-contract-js/open_api3_router_factory.js, line 121

##### 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:
  - vertx-web-api-contract-js/open_api3_router_factory.js, line 187

##### Returns:

Type
  Router

#### mountOperationsWithoutHandlers(enable) → {RouterFactory}

Deprecated. Instantiate and load it using

##### Parameters:

Name | Type | Description
--- | --- | ---
`enable` | boolean |

Source:
  - vertx-web-api-contract-js/open_api3_router_factory.js, line 170

##### Returns:

Type
  RouterFactory

#### setOptions(options) → {RouterFactory}

Override options

##### Parameters:

Name | Type | Description
--- | --- | ---
`options` | Object |

Source:
  - vertx-web-api-contract-js/open_api3_router_factory.js, line 106

##### Returns:

Type
  RouterFactory

#### setValidationFailureHandler(handler) → {RouterFactory}

Deprecated. Instantiate and load it using

##### Parameters:

Name | Type | Description
--- | --- | ---
`handler` | function |

Source:
  - vertx-web-api-contract-js/open_api3_router_factory.js, line 136

##### Returns:

Type
  RouterFactory