public interface RouterBuilder
Router
from an OpenAPI 3 contract.
The router is mounting its handlers in the following order:
InputTrustHandler
. Because of this, all handlers of type PLATFORM,
SECURITY_POLICY, BODY and AUTHENTICATION must be mounted as root handlers if required.
OpenAPIRoute
in the same order as they are
added to the route.
OpenAPIRoute
in the same order as they are
added to the route.
Modifier and Type | Field and Description |
---|---|
static String |
KEY_META_DATA_OPERATION |
static String |
KEY_META_DATA_VALIDATED_REQUEST |
Modifier and Type | Method and Description |
---|---|
static RouterBuilder |
create(Vertx vertx,
OpenAPIContract contract)
Create a new
RouterBuilder . |
static RouterBuilder |
create(Vertx vertx,
OpenAPIContract contract,
RequestExtractor extractor)
Create a new
RouterBuilder . |
Router |
createRouter()
Construct a new router based on the related OpenAPI contract.
|
OpenAPIRoute |
getRoute(String operationId)
Access to a route defined in the contract with
operationId |
List<OpenAPIRoute> |
getRoutes() |
RouterBuilder |
rootHandler(Handler<RoutingContext> rootHandler)
Add global handler to be applied prior to
Router being generated. |
static final String KEY_META_DATA_OPERATION
static final String KEY_META_DATA_VALIDATED_REQUEST
static RouterBuilder create(Vertx vertx, OpenAPIContract contract)
RouterBuilder
. Like create(Vertx, OpenAPIContract, RequestExtractor)
but uses a default
implementation for the extractor.vertx
- the related Vert.x instancecontract
- the contract that describes the endpointRouterBuilder
static RouterBuilder create(Vertx vertx, OpenAPIContract contract, RequestExtractor extractor)
RouterBuilder
.vertx
- the related Vert.x instancecontract
- the contract that describes the endpointextractor
- the extractor is used to extract and transform the parameters and body of the related request in
a format that can be validated by the RequestValidator
.RouterBuilder
OpenAPIRoute getRoute(String operationId)
operationId
operationId
- the id of the operationList<OpenAPIRoute> getRoutes()
RouterBuilder rootHandler(Handler<RoutingContext> rootHandler)
Router
being generated. rootHandler
- the root handler to addRouter createRouter()
Copyright © 2023 Eclipse. All rights reserved.