public interface OpenAPI3RouterFactory extends RouterFactory<io.swagger.v3.oas.models.OpenAPI>
addHandlerByOperationId(String, Handler), in this
class is better than generic RouterFactory.addHandler(HttpMethod, String, Handler)RouterFactory.addHandler(HttpMethod, String, Handler) remember that you have to pass path as declared in openapi specification
Usage example:
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();
}
});
addFailureHandler, addHandler, addSecurityHandler, enableValidationFailureHandler, getOptions, getRouter, mountOperationsWithoutHandlers, setOptions, setValidationFailureHandlerOpenAPI3RouterFactory 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 - 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 AsyncResult@Deprecated static void createRouterFactoryFromFile(Vertx vertx, String url, Handler<AsyncResult<OpenAPI3RouterFactory>> handler)
create(Vertx, String, Handler)vertx - url - handler - @Deprecated static void createRouterFactoryFromURL(Vertx vertx, String url, Handler<AsyncResult<OpenAPI3RouterFactory>> handler)
create(Vertx, String, Handler)vertx - url - handler - Copyright © 2018 Eclipse. All rights reserved.