Interface RouterBuilder


  • public interface RouterBuilder
    Interface to build a Vert.x Web Router from an OpenAPI 3 contract.

    The router is mounting its handlers in the following order:
    1. RootHandler
    2. in the order the root handlers were added to the RouterBuilder.
    3. ValidationHandler
    4. This handler is implementing the marker interface InputTrustHandler. Because of this, all handlers of type PLATFORM, SECURITY_POLICY, BODY and AUTHENTICATION must be mounted as root handlers if required.
    5. UserHandler
    6. The custom user handlers defined in the OpenAPIRoute in the same order as they are added to the route.
    7. FailureHandler
    8. The failure handlers defined in the OpenAPIRoute in the same order as they are added to the route.
    • Method Detail

      • getRoute

        OpenAPIRoute getRoute​(String operationId)
        Access to a route defined in the contract with operationId
        Parameters:
        operationId - the id of the operation
        Returns:
        the requested route, or null if the passed operationId doesn't exist.
      • getRoutes

        List<OpenAPIRoute> getRoutes()
        Returns:
        all routes defined in the contract
      • rootHandler

        RouterBuilder rootHandler​(Handler<RoutingContext> rootHandler)
        Add global handler to be applied prior to Router being generated.
        Parameters:
        rootHandler - the root handler to add
        Returns:
        self
      • createRouter

        Router createRouter()
        Construct a new router based on the related OpenAPI contract.
        Returns:
        a Router based on the related OpenAPI contract.