public class OpenAPI3RouterFactory extends Object implements DesignDrivenRouterFactory<io.swagger.oas.models.OpenAPI>
addHandlerByOperationId(java.lang.String, io.vertx.core.Handler<io.vertx.rxjava.ext.web.RoutingContext>), in this
class is better than generic
OpenAPI3RouterFactory.createRouterFactoryFromFile(vertx, "src/resources/spec.yaml", asyncResult -> {
if (!asyncResult.succeeded()) {
// IO failure or spec invalid else {
OpenAPI3RouterFactory routerFactory = asyncResult.result();
routerFactory.addHandlerByOperationId("operation_id", routingContext -> {
// Do something
}, routingContext -> {
// Do something with failure handler
});
Router router = routerFactory.getRouter();
}
});
}
NOTE: This class has been automatically generated from the original non RX-ified interface using Vert.x codegen.| Modifier and Type | Field and Description |
|---|---|
static TypeArg<OpenAPI3RouterFactory> |
__TYPE_ARG |
| Constructor and Description |
|---|
OpenAPI3RouterFactory(OpenAPI3RouterFactory delegate) |
| Modifier and Type | Method and Description |
|---|---|
DesignDrivenRouterFactory |
addFailureHandler(HttpMethod method,
String path,
Handler<RoutingContext> failureHandler)
Add a failure handler to a path with a method.
|
OpenAPI3RouterFactory |
addFailureHandlerByOperationId(String operationId,
Handler<RoutingContext> failureHandler)
Add a failure handler by operation_id field in Operation object
|
DesignDrivenRouterFactory |
addHandler(HttpMethod method,
String path,
Handler<RoutingContext> handler)
Add an handler to a path with a method.
|
OpenAPI3RouterFactory |
addHandlerByOperationId(String operationId,
Handler<RoutingContext> handler)
Add an handler by operation_id field in Operation object
|
DesignDrivenRouterFactory |
addSecurityHandler(String securitySchemaName,
Handler<RoutingContext> handler)
Mount to paths that have to follow a security schema a security handler
|
OpenAPI3RouterFactory |
addSecuritySchemaScopeValidator(String securitySchemaName,
String scopeName,
Handler<RoutingContext> handler)
Add a particular scope validator.
|
static void |
createRouterFactoryFromFile(Vertx vertx,
String filename,
Handler<AsyncResult<OpenAPI3RouterFactory>> handler)
Create a new OpenAPI3RouterFactory from a filename
|
static void |
createRouterFactoryFromURL(Vertx vertx,
String url,
Handler<AsyncResult<OpenAPI3RouterFactory>> handler)
Create a new OpenAPI3RouterFactory from an url
|
DesignDrivenRouterFactory |
enableValidationFailureHandler(boolean enable)
Enable or disable validation failure handler.
|
boolean |
equals(Object o) |
OpenAPI3RouterFactory |
getDelegate() |
Router |
getRouter()
Construct a new router based on spec.
|
int |
hashCode() |
DesignDrivenRouterFactory |
mountOperationsWithoutHandlers(boolean enable)
Automatic mount handlers that return HTTP 501 status code for operations where you didn't specify an handler.
|
static OpenAPI3RouterFactory |
newInstance(OpenAPI3RouterFactory arg) |
static Single<OpenAPI3RouterFactory> |
rxCreateRouterFactoryFromFile(Vertx vertx,
String filename)
Create a new OpenAPI3RouterFactory from a filename
|
static Single<OpenAPI3RouterFactory> |
rxCreateRouterFactoryFromURL(Vertx vertx,
String url)
Create a new OpenAPI3RouterFactory from an url
|
DesignDrivenRouterFactory |
setValidationFailureHandler(Handler<RoutingContext> handler)
Set default validation failure handler.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitnewInstance, newInstancepublic static final TypeArg<OpenAPI3RouterFactory> __TYPE_ARG
public OpenAPI3RouterFactory(OpenAPI3RouterFactory delegate)
public OpenAPI3RouterFactory getDelegate()
getDelegate in interface DesignDrivenRouterFactory<io.swagger.oas.models.OpenAPI>public DesignDrivenRouterFactory addSecurityHandler(String securitySchemaName, Handler<RoutingContext> handler)
addSecurityHandler in interface DesignDrivenRouterFactory<io.swagger.oas.models.OpenAPI>securitySchemaName - handler - public DesignDrivenRouterFactory addHandler(HttpMethod method, String path, Handler<RoutingContext> handler)
addHandler in interface DesignDrivenRouterFactory<io.swagger.oas.models.OpenAPI>method - path - handler - public DesignDrivenRouterFactory addFailureHandler(HttpMethod method, String path, Handler<RoutingContext> failureHandler)
addFailureHandler in interface DesignDrivenRouterFactory<io.swagger.oas.models.OpenAPI>method - path - failureHandler - public DesignDrivenRouterFactory setValidationFailureHandler(Handler<RoutingContext> handler)
setValidationFailureHandler in interface DesignDrivenRouterFactory<io.swagger.oas.models.OpenAPI>handler - public DesignDrivenRouterFactory enableValidationFailureHandler(boolean enable)
enableValidationFailureHandler in interface DesignDrivenRouterFactory<io.swagger.oas.models.OpenAPI>enable - public DesignDrivenRouterFactory mountOperationsWithoutHandlers(boolean enable)
mountOperationsWithoutHandlers in interface DesignDrivenRouterFactory<io.swagger.oas.models.OpenAPI>enable - public Router getRouter()
getRouter in interface DesignDrivenRouterFactory<io.swagger.oas.models.OpenAPI>public OpenAPI3RouterFactory addSecuritySchemaScopeValidator(String securitySchemaName, String scopeName, Handler<RoutingContext> handler)
securitySchemaName - scopeName - handler - public OpenAPI3RouterFactory addHandlerByOperationId(String operationId, Handler<RoutingContext> handler)
operationId - handler - public OpenAPI3RouterFactory addFailureHandlerByOperationId(String operationId, Handler<RoutingContext> failureHandler)
operationId - failureHandler - public static void createRouterFactoryFromFile(Vertx vertx, String filename, Handler<AsyncResult<OpenAPI3RouterFactory>> handler)
vertx - filename - handler - When specification is loaded, this handler will be called with AsyncResultpublic static Single<OpenAPI3RouterFactory> rxCreateRouterFactoryFromFile(Vertx vertx, String filename)
vertx - filename - public static void createRouterFactoryFromURL(Vertx vertx, String url, Handler<AsyncResult<OpenAPI3RouterFactory>> handler)
vertx - url - handler - When specification is loaded, this handler will be called with AsyncResultpublic static Single<OpenAPI3RouterFactory> rxCreateRouterFactoryFromURL(Vertx vertx, String url)
vertx - url - public static OpenAPI3RouterFactory newInstance(OpenAPI3RouterFactory arg)
Copyright © 2017. All rights reserved.