Interface JsonSchemaEnforceable

All Known Implementing Classes:
JsonSchemaEnforcer

public interface JsonSchemaEnforceable
Used to define all the methods required to verify that a given JSON object satisfies a given JSON Schema.
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    validateWithOutReasoning(Json objectToValidate, Json againstSchema)
    Validate but never throw exceptions
    boolean
    validateWithReasoning(Json objectToValidate, Json againstSchema)
    Validate with the potential to throw exceptions to the caller.
  • Method Details

    • validateWithOutReasoning

      default boolean validateWithOutReasoning(Json objectToValidate, Json againstSchema)
      Validate but never throw exceptions
      Parameters:
      objectToValidate - The JSON Object to be validated.
      againstSchema - The Schema JSON Object which defines the object to be validated.
      Returns:
      True if the object passes validation, False if it fails for any reason.
    • validateWithReasoning

      boolean validateWithReasoning(Json objectToValidate, Json againstSchema) throws SchemaException
      Validate with the potential to throw exceptions to the caller.
      Parameters:
      objectToValidate - The JSON Object to be validated.
      againstSchema - The Schema JSON Object which defines the object to be validated.
      Returns:
      True if the object passes validation, False if it fails for any reason.
      Throws:
      SchemaException - Thrown to give reason/context as to why an object failed validation.