Class OpenAPIContract

java.lang.Object
io.vertx.mutiny.openapi.contract.OpenAPIContract
All Implemented Interfaces:
MutinyDelegate

public class OpenAPIContract extends Object implements MutinyDelegate
  • Field Details

  • Constructor Details

    • OpenAPIContract

      public OpenAPIContract(io.vertx.openapi.contract.OpenAPIContract delegate)
    • OpenAPIContract

      public OpenAPIContract(Object delegate)
  • Method Details

    • getDelegate

      public io.vertx.openapi.contract.OpenAPIContract 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
    • from

      @CheckReturnValue public static io.smallrye.mutiny.Uni<OpenAPIContract> from(Vertx vertx, String unresolvedContractPath)
      Resolves / dereferences the passed contract and creates an OpenAPIContract instance.

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

      Parameters:
      vertx - The related Vert.x instance.
      unresolvedContractPath - The path to the unresolved contract.
      Returns:
      the uni firing the result of the operation when completed, or a failure if the operation failed.
    • fromAndAwait

      public static OpenAPIContract fromAndAwait(Vertx vertx, String unresolvedContractPath)
      Blocking variant of from(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 - The related Vert.x instance.
      unresolvedContractPath - The path to the unresolved contract.
      Returns:
      the OpenAPIContract instance produced by the operation.
    • fromAndForget

      public static void fromAndForget(Vertx vertx, String unresolvedContractPath)
      Variant of from(io.vertx.mutiny.core.Vertx,String) that ignores the result of the operation.

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

      Parameters:
      vertx - The related Vert.x instance.
      unresolvedContractPath - The path to the unresolved contract.
    • from

      @CheckReturnValue public static io.smallrye.mutiny.Uni<OpenAPIContract> from(Vertx vertx, io.vertx.core.json.JsonObject unresolvedContract)
      Resolves / dereferences the passed contract and creates an OpenAPIContract instance.

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

      Parameters:
      vertx - The related Vert.x instance.
      unresolvedContract - The unresolved contract.
      Returns:
      the uni firing the result of the operation when completed, or a failure if the operation failed.
    • fromAndAwait

      public static OpenAPIContract fromAndAwait(Vertx vertx, io.vertx.core.json.JsonObject unresolvedContract)
      Blocking variant of from(io.vertx.mutiny.core.Vertx,JsonObject).

      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 - The related Vert.x instance.
      unresolvedContract - The unresolved contract.
      Returns:
      the OpenAPIContract instance produced by the operation.
    • fromAndForget

      public static void fromAndForget(Vertx vertx, io.vertx.core.json.JsonObject unresolvedContract)
      Variant of from(io.vertx.mutiny.core.Vertx,JsonObject) that ignores the result of the operation.

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

      Parameters:
      vertx - The related Vert.x instance.
      unresolvedContract - The unresolved contract.
    • from

      @CheckReturnValue public static io.smallrye.mutiny.Uni<OpenAPIContract> from(Vertx vertx, String unresolvedContractPath, Map<String,String> additionalContractFiles)
      Resolves / dereferences the passed contract and creates an OpenAPIContract instance.

      This method can be used in case that the contract is split into several files. These files can be passed in a Map that has the reference as key and the path to the file as value.

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

      Parameters:
      vertx - The related Vert.x instance.
      unresolvedContractPath - The path to the unresolved contract.
      additionalContractFiles - The additional contract files
      Returns:
      the uni firing the result of the operation when completed, or a failure if the operation failed.
    • fromAndAwait

      public static OpenAPIContract fromAndAwait(Vertx vertx, String unresolvedContractPath, Map<String,String> additionalContractFiles)
      Blocking variant of from(io.vertx.mutiny.core.Vertx,String,Map).

      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 - The related Vert.x instance.
      unresolvedContractPath - The path to the unresolved contract.
      additionalContractFiles - The additional contract files
      Returns:
      the OpenAPIContract instance produced by the operation.
    • fromAndForget

      public static void fromAndForget(Vertx vertx, String unresolvedContractPath, Map<String,String> additionalContractFiles)
      Variant of from(io.vertx.mutiny.core.Vertx,String,Map) that ignores the result of the operation.

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

      Parameters:
      vertx - The related Vert.x instance.
      unresolvedContractPath - The path to the unresolved contract.
      additionalContractFiles - The additional contract files
    • from

      @CheckReturnValue public static io.smallrye.mutiny.Uni<OpenAPIContract> from(Vertx vertx, io.vertx.core.json.JsonObject unresolvedContract, Map<String,io.vertx.core.json.JsonObject> additionalContractFiles)
      Resolves / dereferences the passed contract and creates an OpenAPIContract instance.

      This method can be used in case that the contract is split into several files. These files can be passed in a Map that has the reference as key and the path to the file as value.

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

      Parameters:
      vertx - The related Vert.x instance.
      unresolvedContract - The unresolved contract.
      additionalContractFiles - The additional contract files
      Returns:
      the uni firing the result of the operation when completed, or a failure if the operation failed.
    • fromAndAwait

      public static OpenAPIContract fromAndAwait(Vertx vertx, io.vertx.core.json.JsonObject unresolvedContract, Map<String,io.vertx.core.json.JsonObject> additionalContractFiles)
      Blocking variant of from(io.vertx.mutiny.core.Vertx,JsonObject,Map).

      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 - The related Vert.x instance.
      unresolvedContract - The unresolved contract.
      additionalContractFiles - The additional contract files
      Returns:
      the OpenAPIContract instance produced by the operation.
    • fromAndForget

      public static void fromAndForget(Vertx vertx, io.vertx.core.json.JsonObject unresolvedContract, Map<String,io.vertx.core.json.JsonObject> additionalContractFiles)
      Variant of from(io.vertx.mutiny.core.Vertx,JsonObject,Map) that ignores the result of the operation.

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

      Parameters:
      vertx - The related Vert.x instance.
      unresolvedContract - The unresolved contract.
      additionalContractFiles - The additional contract files
    • operation

      public Operation operation(String operationId)
      Parameters:
      operationId - the id of the operation.
      Returns:
      the requested operation.
    • operations

      public List<Operation> operations()
      Returns:
      all operations defined in the contract.
    • getPaths

      public List<Path> getPaths()
      Returns:
      all Paths defined in the OpenAPI contract.
    • getRawContract

      public io.vertx.core.json.JsonObject getRawContract()
      Returns:
      the resolved OpenAPI contract as .
    • getVersion

      public io.vertx.openapi.contract.OpenAPIVersion getVersion()
      Returns:
      the OpenAPI version of the contract.
    • getSchemaRepository

      public SchemaRepository getSchemaRepository()
      Returns:
      the to validate against.
    • getServers

      public List<Server> getServers()
      Returns:
      the servers of the contract.
    • findPath

      public Path findPath(String urlPath)
      Parameters:
      urlPath - The path of the request.
      Returns:
      the found Path object, or null if the passed path doesn't match any Path object.
    • findOperation

      public Operation findOperation(String urlPath, io.vertx.core.http.HttpMethod method)
      Parameters:
      urlPath - The path of the request.
      method - The method of the request.
      Returns:
      the found Operation object, or null if the passed path and method doesn't match any Operation object.
    • getSecurityRequirements

      public List<SecurityRequirement> getSecurityRequirements()
      Returns:
      The related security requirement.
    • securityScheme

      public SecurityScheme securityScheme(String name)
      Parameters:
      name - The name of the security scheme.
      Returns:
      the found SecurityScheme object, or null if the passed path and method doesn't match any Operation object.
    • newInstance

      public static OpenAPIContract newInstance(io.vertx.openapi.contract.OpenAPIContract arg)