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 {@link NoSyncValidationException}
To check the schema state you can use method . Note that invoking {@link Schema#validateAsync} generally doesn't have any additional overhead than invoking {@link Schema#validateSync}.
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
Interface representing a Json Schema
A schema could have two states:
To check the schema state you can use method . Note that invoking {@link Schema#validateAsync} generally doesn't have any additional overhead than invoking {@link Schema#validateSync}.
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