Class RouterBuilder

java.lang.Object
io.vertx.mutiny.ext.web.openapi.router.RouterBuilder
All Implemented Interfaces:
MutinyDelegate

public class RouterBuilder extends Object implements MutinyDelegate
Interface to build a Vert.x Web 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.

NOTE: This class has been automatically generated from the original non Mutiny-ified interface using Vert.x codegen.

  • Field Details

  • Constructor Details

    • RouterBuilder

      public RouterBuilder(io.vertx.ext.web.openapi.router.RouterBuilder delegate)
    • RouterBuilder

      public RouterBuilder(Object delegate)
  • Method Details

    • getDelegate

      public io.vertx.ext.web.openapi.router.RouterBuilder getDelegate()
      Specified by:
      getDelegate in interface MutinyDelegate
      Returns:
      the delegate used by this Mutiny object of generated type
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • create

      public static RouterBuilder create(Vertx vertx, OpenAPIContract contract)
      Parameters:
      vertx - the related Vert.x instance
      contract - the contract that describes the endpoint
      Returns:
      an instance of RouterBuilder
    • create

      public static RouterBuilder create(Vertx vertx, OpenAPIContract contract, RequestExtractor extractor)
      Parameters:
      vertx - the related Vert.x instance
      contract - the contract that describes the endpoint
      extractor - 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.
      Returns:
      an instance of RouterBuilder
    • getRoute

      public OpenAPIRoute getRoute(String operationId)
      Parameters:
      operationId - the id of the operation
      Returns:
      the requested route, or null if the passed operationId doesn't exist.
    • getRoutes

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

      public RouterBuilder rootHandler(Consumer<RoutingContext> rootHandler)
      Parameters:
      rootHandler - the root handler to add
      Returns:
    • createRouter

      public Router createRouter()
      Returns:
      a Router based on the related OpenAPI contract.
    • newInstance

      public static RouterBuilder newInstance(io.vertx.ext.web.openapi.router.RouterBuilder arg)