Class JsonSchemaValidator

java.lang.Object
com.bonitasoft.processbuilder.validation.JsonSchemaValidator

public final class JsonSchemaValidator extends Object
Utility class serving as the entry point for JSON Schema validation. It prepares the input, determines the target schema, and delegates the schema loading and validation to SchemaResolver.

This class uses SLF4J for logging all validation results and errors and is non-instantiable.

Since:
1.0
Author:
Bonitasoft
  • Method Details

    • isJsonValidForType

      public static boolean isJsonValidForType(String actionType, String optionType, Object jsonInput)
      Validates an input object against the schema corresponding to the given option type name. This method handles input serialization, determines the final schema name (based on action type), and delegates the core validation logic.
      Parameters:
      actionType - The action being performed (e.g., "DELETE", "INSERT", "UPDATE").
      optionType - The name of the schema to validate against (e.g., "Category", "Steps").
      jsonInput - The JSON content to validate (can be String, Map, or any serializable object).
      Returns:
      true if validation is successful, false otherwise (due to null inputs, serialization failure, or schema validation/loading errors).