Class Schema

java.lang.Object
io.vertx.mutiny.json.schema.Schema
All Implemented Interfaces:
MutinyDelegate

@Deprecated public class Schema extends Object implements MutinyDelegate
Deprecated.
Interface representing a Json Schema

A schema could have two states:

  • Synchronous: The validators tree can provide a synchronous validation, so you can validate your json both using and
  • Asynchronous: One or more branches of the validator tree requires an asynchronous validation, so you must use to validate your json. If you use it will throw a NoSyncValidationException

To check the schema state you can use method . Note that invoking validateAsync(java.lang.Object) generally doesn't have any additional overhead than invoking validateSync(java.lang.Object).
The schema can mutate the state in time, e.g. if you have a schema that is asynchronous because of a $ref, after the first validation the external schema is cached inside SchemaRouter and this schema will switch to synchronous state

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

  • Field Details

    • __TYPE_ARG

      public static final TypeArg<Schema> __TYPE_ARG
      Deprecated.
  • Constructor Details

    • Schema

      public Schema(io.vertx.json.schema.Schema delegate)
      Deprecated.
    • Schema

      public Schema(Object delegate)
      Deprecated.
  • Method Details

    • getDelegate

      public io.vertx.json.schema.Schema getDelegate()
      Deprecated.
      Specified by:
      getDelegate in interface MutinyDelegate
      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
    • validateAsync

      @CheckReturnValue @Deprecated public io.smallrye.mutiny.Uni<Void> validateAsync(Object json)
      Deprecated.
      Validate the json performing an asynchronous validation.

      Note: If the schema is synchronous, this method will call internally

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

      Parameters:
      json - input to validate
      Returns:
      the uni firing the result of the operation when completed, or a failure if the operation failed.
    • validateAsyncAndAwait

      @Deprecated public Void validateAsyncAndAwait(Object json)
      Deprecated.
      Blocking variant of validateAsync(Object).

      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:
      json - input to validate
      Returns:
      the Void instance produced by the operation.
    • validateAsyncAndForget

      @Deprecated public void validateAsyncAndForget(Object json)
      Deprecated.
      Variant of validateAsync(Object) that ignores the result of the operation.

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

      Parameters:
      json - input to validate
    • validateSync

      @Deprecated public void validateSync(Object json)
      Deprecated.
      Parameters:
      json - input to validate
    • getScope

      @Deprecated public JsonPointer getScope()
      Deprecated.
      Returns:
      scope of this schema
    • getJson

      @Deprecated public Object getJson()
      Deprecated.
      Returns:
      Json representation of the schema
    • isSync

      @Deprecated public boolean isSync()
      Deprecated.
      Returns:
      true if this validator can provide a synchronous validation.
    • newInstance

      public static Schema newInstance(io.vertx.json.schema.Schema arg)
      Deprecated.