public interface OpenAPI3RouterFactory extends RouterFactory<io.swagger.v3.oas.models.OpenAPI>
addHandlerByOperationId(String, Handler)
OpenAPI3RouterFactory.create(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();
}
});
this#setBodyHandler(BodyHandler)
this#addGlobalHandler(Handler)
Modifier and Type | Method and Description |
---|---|
OpenAPI3RouterFactory |
addFailureHandlerByOperationId(String operationId,
Handler<RoutingContext> failureHandler)
Add a failure handler by operation_id field in Operation object
|
OpenAPI3RouterFactory |
addHandlerByOperationId(String operationId,
Handler<RoutingContext> handler)
Add an handler by operation_id field in Operation object
|
OpenAPI3RouterFactory |
addSecuritySchemaScopeValidator(String securitySchemaName,
String scopeName,
Handler<RoutingContext> handler)
Add a particular scope validator.
|
static void |
create(Vertx vertx,
String url,
Handler<AsyncResult<OpenAPI3RouterFactory>> handler)
Create a new OpenAPI3RouterFactory
|
static void |
create(Vertx vertx,
String url,
List<JsonObject> auth,
Handler<AsyncResult<OpenAPI3RouterFactory>> handler)
Create a new OpenAPI3RouterFactory
|
OpenAPI3RouterFactory |
mountOperationToEventBus(String operationId,
String address)
Specify to route an incoming request for specified operation id to a Web Api Service mounted at the specified address on event bus.
|
OpenAPI3RouterFactory |
mountServiceFromTag(String tag,
String address)
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.
|
OpenAPI3RouterFactory |
mountServiceInterface(Class interfaceClass,
String address)
Introspect the Web Api Service interface to route to service all matching method names with operation ids.
|
OpenAPI3RouterFactory |
mountServicesFromExtensions()
Introspect the OpenAPI spec to mount handlers for all operations that specifies a x-vertx-event-bus annotation.
|
addGlobalHandler, addSecurityHandler, getOptions, getRouter, getValidationFailureHandler, setBodyHandler, setExtraOperationContextPayloadMapper, setNotImplementedFailureHandler, setOptions, setValidationFailureHandler
OpenAPI3RouterFactory addSecuritySchemaScopeValidator(String securitySchemaName, String scopeName, Handler<RoutingContext> handler)
securitySchemaName
- scopeName
- handler
- OpenAPI3RouterFactory addHandlerByOperationId(String operationId, Handler<RoutingContext> handler)
operationId
- handler
- OpenAPI3RouterFactory addFailureHandlerByOperationId(String operationId, Handler<RoutingContext> failureHandler)
operationId
- failureHandler
- OpenAPI3RouterFactory mountOperationToEventBus(String operationId, String address)
operationId
- address
- OpenAPI3RouterFactory mountServiceFromTag(String tag, String address)
tag
- address
- OpenAPI3RouterFactory mountServicesFromExtensions()
OpenAPI3RouterFactory mountServiceInterface(Class interfaceClass, String address)
static void create(Vertx vertx, String url, Handler<AsyncResult<OpenAPI3RouterFactory>> handler)
vertx
- url
- location of your spec. It can be an absolute path, a local path or remote url (with HTTP protocol)handler
- When specification is loaded, this handler will be called with AsyncResultstatic void create(Vertx vertx, String url, List<JsonObject> auth, Handler<AsyncResult<OpenAPI3RouterFactory>> handler)
vertx
- url
- location of your spec. It can be an absolute path, a local path or remote url (with HTTP protocol)auth
- list of authorization values needed to access the remote url. Each item should be json representation
of an AuthorizationValue
handler
- When specification is loaded, this handler will be called with AsyncResultCopyright © 2023 Eclipse. All rights reserved.