public class RouterBuilder extends Object
operation(java.lang.String)
(String, Handler)}
RouterBuilder.create(vertx, "src/resources/spec.yaml", asyncResult -> {
if (!asyncResult.succeeded()) {
// IO failure or spec invalid
else {
RouterBuilder routerBuilder = asyncResult.result();
RouterBuilder.operation("operation_id").handler(routingContext -> {
// Do something
}, routingContext -> {
// Do something with failure handler
});
Router router = routerBuilder.createRouter();
}
});
}
original
non RX-ified interface using Vert.x codegen.Modifier and Type | Field and Description |
---|---|
static io.vertx.lang.rx.TypeArg<RouterBuilder> |
__TYPE_ARG |
Constructor and Description |
---|
RouterBuilder(Object delegate) |
RouterBuilder(RouterBuilder delegate) |
Modifier and Type | Method and Description |
---|---|
RouterBuilder |
bodyHandler(BodyHandler bodyHandler)
Deprecated.
|
static Single<RouterBuilder> |
create(Vertx vertx,
String url)
Like
|
static Single<RouterBuilder> |
create(Vertx vertx,
String url,
OpenAPILoaderOptions options)
Like
|
Router |
createRouter()
Construct a new router based on spec.
|
boolean |
equals(Object o) |
RouterBuilder |
getDelegate() |
OpenAPIHolder |
getOpenAPI() |
RouterBuilderOptions |
getOptions() |
SchemaParser |
getSchemaParser()
Deprecated.
|
SchemaRouter |
getSchemaRouter()
Deprecated.
|
int |
hashCode() |
RouterBuilder |
mountServicesFromExtensions()
Introspect the OpenAPI spec to mount handlers for all operations that specifies a x-vertx-event-bus annotation.
|
static RouterBuilder |
newInstance(RouterBuilder arg) |
Operation |
operation(String operationId)
Access to an operation defined in the contract with
operationId |
List<Operation> |
operations() |
RouterBuilder |
rootHandler(Handler<RoutingContext> rootHandler)
Add global handler to be applied prior to being generated.
|
static Single<RouterBuilder> |
rxCreate(Vertx vertx,
String url)
Like
|
static Single<RouterBuilder> |
rxCreate(Vertx vertx,
String url,
OpenAPILoaderOptions options)
Like
|
SecurityScheme |
securityHandler(String securitySchemeName)
Creates a new security scheme for the required .
|
RouterBuilder |
securityHandler(String securitySchemeName,
AuthenticationHandler handler)
Mount to paths that have to follow a security schema a security handler.
|
RouterBuilder |
serviceExtraPayloadMapper(java.util.function.Function<RoutingContext,JsonObject> serviceExtraPayloadMapper)
When set, this function is called while creating the payload of
|
RouterBuilder |
setOptions(RouterBuilderOptions options)
Set options of router builder.
|
String |
toString() |
public static final io.vertx.lang.rx.TypeArg<RouterBuilder> __TYPE_ARG
public RouterBuilder(RouterBuilder delegate)
public RouterBuilder(Object delegate)
public RouterBuilder getDelegate()
public Operation operation(String operationId)
operationId
operationId
- the id of the operation@Deprecated public RouterBuilder bodyHandler(BodyHandler bodyHandler)
bodyHandler
- public RouterBuilder rootHandler(Handler<RoutingContext> rootHandler)
bodyHandler(io.vertx.rxjava3.ext.web.handler.BodyHandler)
rootHandler
- public RouterBuilder mountServicesFromExtensions()
public RouterBuilder setOptions(RouterBuilderOptions options)
RouterBuilderOptions
options
- public RouterBuilderOptions getOptions()
RouterBuilderOptions
public OpenAPIHolder getOpenAPI()
$ref
s@Deprecated public SchemaRouter getSchemaRouter()
Schema
instances@Deprecated public SchemaParser getSchemaParser()
Schema
public RouterBuilder serviceExtraPayloadMapper(java.util.function.Function<RoutingContext,JsonObject> serviceExtraPayloadMapper)
serviceExtraPayloadMapper
- public SecurityScheme securityHandler(String securitySchemeName)
securitySchemeName
- public Router createRouter()
public static Single<RouterBuilder> create(Vertx vertx, String url)
vertx
- url
- public static Single<RouterBuilder> rxCreate(Vertx vertx, String url)
vertx
- url
- public static Single<RouterBuilder> create(Vertx vertx, String url, OpenAPILoaderOptions options)
vertx
- url
- options
- public static Single<RouterBuilder> rxCreate(Vertx vertx, String url, OpenAPILoaderOptions options)
vertx
- url
- options
- public RouterBuilder securityHandler(String securitySchemeName, AuthenticationHandler handler)
securitySchemeName
is present in the OpenAPI document.
For must use cases the method securityHandler(java.lang.String)
should be used.securitySchemeName
- the components security scheme idhandler
- the authentication handlerpublic static RouterBuilder newInstance(RouterBuilder arg)
Copyright © 2024 Eclipse. All rights reserved.