public class OpenAPI3RouterFactory extends Object implements RouterFactory<io.swagger.v3.oas.models.OpenAPI>
addHandlerByOperationId(java.lang.String, io.vertx.core.Handler<io.vertx.rxjava.ext.web.RoutingContext>)
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();
}
});
}
original
non RX-ified interface using Vert.x codegen.Modifier and Type | Field and Description |
---|---|
static io.vertx.lang.rx.TypeArg<OpenAPI3RouterFactory> |
__TYPE_ARG |
Constructor and Description |
---|
OpenAPI3RouterFactory(Object delegate) |
OpenAPI3RouterFactory(OpenAPI3RouterFactory delegate) |
Modifier and Type | Method and Description |
---|---|
OpenAPI3RouterFactory |
addFailureHandlerByOperationId(String operationId,
Handler<RoutingContext> failureHandler)
Add a failure handler by operation_id field in Operation object
|
RouterFactory |
addGlobalHandler(Handler<RoutingContext> globalHandler)
Add global handler to be applied prior to
Router being generated. |
OpenAPI3RouterFactory |
addHandlerByOperationId(String operationId,
Handler<RoutingContext> handler)
Add an handler by operation_id field in Operation object
|
RouterFactory |
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 |
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
|
static Observable<OpenAPI3RouterFactory> |
createObservable(Vertx vertx,
String url)
Deprecated.
|
static Observable<OpenAPI3RouterFactory> |
createObservable(Vertx vertx,
String url,
List<JsonObject> auth)
Deprecated.
|
boolean |
equals(Object o) |
OpenAPI3RouterFactory |
getDelegate() |
RouterFactoryOptions |
getOptions()
Get options of router factory.
|
Router |
getRouter()
Construct a new router based on spec.
|
Handler<RoutingContext> |
getValidationFailureHandler()
Deprecated.
|
int |
hashCode() |
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 |
mountServicesFromExtensions()
Introspect the OpenAPI spec to mount handlers for all operations that specifies a x-vertx-event-bus annotation.
|
static OpenAPI3RouterFactory |
newInstance(OpenAPI3RouterFactory arg) |
static Single<OpenAPI3RouterFactory> |
rxCreate(Vertx vertx,
String url)
Create a new OpenAPI3RouterFactory
|
static Single<OpenAPI3RouterFactory> |
rxCreate(Vertx vertx,
String url,
List<JsonObject> auth)
Create a new OpenAPI3RouterFactory
|
RouterFactory |
setBodyHandler(BodyHandler bodyHandler)
Supply your own BodyHandler if you would like to control body limit, uploads directory and deletion of uploaded files
|
RouterFactory |
setExtraOperationContextPayloadMapper(java.util.function.Function<RoutingContext,JsonObject> extraOperationContextPayloadMapper)
When set, this function is called while creating the payload of
OperationRequest |
RouterFactory |
setNotImplementedFailureHandler(Handler<RoutingContext> notImplementedFailureHandler)
Deprecated.
|
RouterFactory |
setOptions(RouterFactoryOptions options)
Set options of router factory.
|
RouterFactory |
setValidationFailureHandler(Handler<RoutingContext> validationFailureHandler)
Deprecated.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
newInstance, newInstance
public static final io.vertx.lang.rx.TypeArg<OpenAPI3RouterFactory> __TYPE_ARG
public OpenAPI3RouterFactory(OpenAPI3RouterFactory delegate)
public OpenAPI3RouterFactory(Object delegate)
public OpenAPI3RouterFactory getDelegate()
getDelegate
in interface RouterFactory<io.swagger.v3.oas.models.OpenAPI>
public RouterFactory addSecurityHandler(String securitySchemaName, Handler<RoutingContext> handler)
addSecurityHandler
in interface RouterFactory<io.swagger.v3.oas.models.OpenAPI>
securitySchemaName
- handler
- public RouterFactory setOptions(RouterFactoryOptions options)
setOptions
in interface RouterFactory<io.swagger.v3.oas.models.OpenAPI>
options
- public RouterFactoryOptions getOptions()
getOptions
in interface RouterFactory<io.swagger.v3.oas.models.OpenAPI>
public Router getRouter()
getRouter
in interface RouterFactory<io.swagger.v3.oas.models.OpenAPI>
@Deprecated public Handler<RoutingContext> getValidationFailureHandler()
getValidationFailureHandler
in interface RouterFactory<io.swagger.v3.oas.models.OpenAPI>
@Deprecated public RouterFactory setValidationFailureHandler(Handler<RoutingContext> validationFailureHandler)
setValidationFailureHandler
in interface RouterFactory<io.swagger.v3.oas.models.OpenAPI>
validationFailureHandler
- @Deprecated public RouterFactory setNotImplementedFailureHandler(Handler<RoutingContext> notImplementedFailureHandler)
setNotImplementedFailureHandler
in interface RouterFactory<io.swagger.v3.oas.models.OpenAPI>
notImplementedFailureHandler
- public RouterFactory setBodyHandler(BodyHandler bodyHandler)
setBodyHandler
in interface RouterFactory<io.swagger.v3.oas.models.OpenAPI>
bodyHandler
- public RouterFactory addGlobalHandler(Handler<RoutingContext> globalHandler)
Router
being generated. addGlobalHandler
in interface RouterFactory<io.swagger.v3.oas.models.OpenAPI>
globalHandler
- public RouterFactory setExtraOperationContextPayloadMapper(java.util.function.Function<RoutingContext,JsonObject> extraOperationContextPayloadMapper)
OperationRequest
setExtraOperationContextPayloadMapper
in interface RouterFactory<io.swagger.v3.oas.models.OpenAPI>
extraOperationContextPayloadMapper
- 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 OpenAPI3RouterFactory mountOperationToEventBus(String operationId, String address)
operationId
- address
- public OpenAPI3RouterFactory mountServiceFromTag(String tag, String address)
tag
- address
- public OpenAPI3RouterFactory mountServicesFromExtensions()
public 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 public static Observable<OpenAPI3RouterFactory> createObservable(Vertx vertx, String url)
rxCreate(io.vertx.rxjava.core.Vertx, java.lang.String)
insteadvertx
- url
- location of your spec. It can be an absolute path, a local path or remote url (with HTTP protocol)public static Single<OpenAPI3RouterFactory> rxCreate(Vertx vertx, String url)
vertx
- url
- location of your spec. It can be an absolute path, a local path or remote url (with HTTP protocol)public static 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 anhandler
- When specification is loaded, this handler will be called with AsyncResult@Deprecated public static Observable<OpenAPI3RouterFactory> createObservable(Vertx vertx, String url, List<JsonObject> auth)
rxCreate(io.vertx.rxjava.core.Vertx, java.lang.String)
insteadvertx
- 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 anpublic static Single<OpenAPI3RouterFactory> rxCreate(Vertx vertx, String url, List<JsonObject> auth)
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 anpublic static OpenAPI3RouterFactory newInstance(OpenAPI3RouterFactory arg)
Copyright © 2023 Eclipse. All rights reserved.