Class OpenAPI3RouterFactory

java.lang.Object
io.vertx.mutiny.ext.web.api.contract.openapi3.OpenAPI3RouterFactory
All Implemented Interfaces:
MutinyDelegate, RouterFactory

@Deprecated public class OpenAPI3RouterFactory extends Object implements MutinyDelegate, RouterFactory
Deprecated.
Interface for OpenAPI3RouterFactory.
To add an handler, use addHandlerByOperationId(java.lang.String, java.util.function.Consumer<io.vertx.mutiny.ext.web.RoutingContext>)
Usage example:
 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();
  }
 });
 }
 

Handlers are loaded in this order:
  1. Body handler (Customizable with
  2. Custom global handlers configurable with
  3. Global security handlers defined in upper spec level
  4. Operation specific security handlers
  5. Generated validation handler
  6. User handlers or "Not implemented" handler

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

  • Field Details

  • Constructor Details

    • OpenAPI3RouterFactory

      public OpenAPI3RouterFactory(io.vertx.ext.web.api.contract.openapi3.OpenAPI3RouterFactory delegate)
      Deprecated.
    • OpenAPI3RouterFactory

      public OpenAPI3RouterFactory(Object delegate)
      Deprecated.
  • Method Details

    • getDelegate

      public io.vertx.ext.web.api.contract.openapi3.OpenAPI3RouterFactory getDelegate()
      Deprecated.
      Specified by:
      getDelegate in interface MutinyDelegate
      Specified by:
      getDelegate in interface RouterFactory
      Returns:
      the delegate used by this Mutiny object of generated type
    • toString

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

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

      public int hashCode()
      Deprecated.
      Overrides:
      hashCode in class Object
    • addSecurityHandler

      @Deprecated public RouterFactory addSecurityHandler(String securitySchemaName, Consumer<RoutingContext> handler)
      Deprecated.
      Specified by:
      addSecurityHandler in interface RouterFactory
      Parameters:
      securitySchemaName -
      handler -
      Returns:
    • setOptions

      @Deprecated public RouterFactory setOptions(io.vertx.ext.web.api.contract.RouterFactoryOptions options)
      Deprecated.
      Specified by:
      setOptions in interface RouterFactory
      Parameters:
      options -
      Returns:
    • getOptions

      @Deprecated public io.vertx.ext.web.api.contract.RouterFactoryOptions getOptions()
      Deprecated.
      Specified by:
      getOptions in interface RouterFactory
      Returns:
    • getRouter

      @Deprecated public Router getRouter()
      Deprecated.
      Specified by:
      getRouter in interface RouterFactory
      Returns:
    • getValidationFailureHandler

      @Deprecated public io.vertx.core.Handler<RoutingContext> getValidationFailureHandler()
      Deprecated.
      Router Factory won't manage the validation errors anymore. You must use Router.errorHandler(int, Handler) with 400 error
      Specified by:
      getValidationFailureHandler in interface RouterFactory
      Returns:
    • setValidationFailureHandler

      @Deprecated public RouterFactory setValidationFailureHandler(Consumer<RoutingContext> validationFailureHandler)
      Deprecated.
      Router Factory won't manage the validation errors anymore. You must use Router.errorHandler(int, Handler) with 400 error
      Specified by:
      setValidationFailureHandler in interface RouterFactory
      Parameters:
      validationFailureHandler -
      Returns:
    • setNotImplementedFailureHandler

      @Deprecated public RouterFactory setNotImplementedFailureHandler(Consumer<RoutingContext> notImplementedFailureHandler)
      Deprecated.
      You must use Router.errorHandler(int, Handler) with 501 error
      Specified by:
      setNotImplementedFailureHandler in interface RouterFactory
      Parameters:
      notImplementedFailureHandler -
      Returns:
    • setBodyHandler

      @Deprecated public RouterFactory setBodyHandler(BodyHandler bodyHandler)
      Deprecated.
      Specified by:
      setBodyHandler in interface RouterFactory
      Parameters:
      bodyHandler -
      Returns:
      self
    • addGlobalHandler

      @Deprecated public RouterFactory addGlobalHandler(Consumer<RoutingContext> globalHandler)
      Deprecated.
      Specified by:
      addGlobalHandler in interface RouterFactory
      Parameters:
      globalHandler -
      Returns:
    • setExtraOperationContextPayloadMapper

      @Deprecated public RouterFactory setExtraOperationContextPayloadMapper(Function<RoutingContext,io.vertx.core.json.JsonObject> extraOperationContextPayloadMapper)
      Deprecated.
      Specified by:
      setExtraOperationContextPayloadMapper in interface RouterFactory
      Parameters:
      extraOperationContextPayloadMapper -
      Returns:
    • addSecuritySchemaScopeValidator

      @Deprecated public OpenAPI3RouterFactory addSecuritySchemaScopeValidator(String securitySchemaName, String scopeName, Consumer<RoutingContext> handler)
      Deprecated.
      Parameters:
      securitySchemaName -
      scopeName -
      handler -
      Returns:
    • addHandlerByOperationId

      @Deprecated public OpenAPI3RouterFactory addHandlerByOperationId(String operationId, Consumer<RoutingContext> handler)
      Deprecated.
      Parameters:
      operationId -
      handler -
      Returns:
    • addFailureHandlerByOperationId

      @Deprecated public OpenAPI3RouterFactory addFailureHandlerByOperationId(String operationId, Consumer<RoutingContext> failureHandler)
      Deprecated.
      Parameters:
      operationId -
      failureHandler -
      Returns:
    • mountOperationToEventBus

      @Deprecated public OpenAPI3RouterFactory mountOperationToEventBus(String operationId, String address)
      Deprecated.
      Parameters:
      operationId -
      address -
      Returns:
      this factory
    • mountServiceFromTag

      @Deprecated public OpenAPI3RouterFactory mountServiceFromTag(String tag, String address)
      Deprecated.
      Parameters:
      tag -
      address -
      Returns:
      this factory
    • mountServicesFromExtensions

      @Deprecated public OpenAPI3RouterFactory mountServicesFromExtensions()
      Deprecated.
      Returns:
      this factory
    • create

      @CheckReturnValue @Deprecated public static io.smallrye.mutiny.Uni<OpenAPI3RouterFactory> create(Vertx vertx, String url)
      Deprecated.
      Create a new OpenAPI3RouterFactory

      Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

      Parameters:
      vertx -
      url - location of your spec. It can be an absolute path, a local path or remote url (with HTTP protocol)
      Returns:
      the uni firing the result of the operation when completed, or a failure if the operation failed.
    • createAndAwait

      @Deprecated public static OpenAPI3RouterFactory createAndAwait(Vertx vertx, String url)
      Deprecated.
      Blocking variant of create(io.vertx.mutiny.core.Vertx,String).

      This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      vertx -
      url - location of your spec. It can be an absolute path, a local path or remote url (with HTTP protocol)
      Returns:
      the OpenAPI3RouterFactory instance produced by the operation.
    • createAndForget

      @Deprecated public static void createAndForget(Vertx vertx, String url)
      Deprecated.
      Variant of create(io.vertx.mutiny.core.Vertx,String) that ignores the result of the operation.

      This method subscribes on the result of create(io.vertx.mutiny.core.Vertx,String), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from create(io.vertx.mutiny.core.Vertx,String) but you don't need to compose it with other operations.

      Parameters:
      vertx -
      url - location of your spec. It can be an absolute path, a local path or remote url (with HTTP protocol)
    • create

      @CheckReturnValue @Deprecated public static io.smallrye.mutiny.Uni<OpenAPI3RouterFactory> create(Vertx vertx, String url, List<io.vertx.core.json.JsonObject> auth)
      Deprecated.
      Create a new OpenAPI3RouterFactory

      Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

      Parameters:
      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 an AuthorizationValue
      Returns:
      the uni firing the result of the operation when completed, or a failure if the operation failed.
    • createAndAwait

      @Deprecated public static OpenAPI3RouterFactory createAndAwait(Vertx vertx, String url, List<io.vertx.core.json.JsonObject> auth)
      Deprecated.
      Blocking variant of create(io.vertx.mutiny.core.Vertx,String,List).

      This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      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 an AuthorizationValue
      Returns:
      the OpenAPI3RouterFactory instance produced by the operation.
    • createAndForget

      @Deprecated public static void createAndForget(Vertx vertx, String url, List<io.vertx.core.json.JsonObject> auth)
      Deprecated.
      Variant of create(io.vertx.mutiny.core.Vertx,String,List) that ignores the result of the operation.

      This method subscribes on the result of create(io.vertx.mutiny.core.Vertx,String,List), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from create(io.vertx.mutiny.core.Vertx,String,List) but you don't need to compose it with other operations.

      Parameters:
      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 an AuthorizationValue
    • newInstance

      public static OpenAPI3RouterFactory newInstance(io.vertx.ext.web.api.contract.openapi3.OpenAPI3RouterFactory arg)
      Deprecated.