Validate a JSON object. Spec is a Prolog representation of the
schema that is optimized for validation. This representation is
derived from JSON data using json_compile_schema/3. Options:
- on_error(Mode)
- What to do if an error is found. Defined modes are
- error
- Raise an exception. This is the default. Note that
only the first error is reported this way.
- warning
- Print a message
- silent
- Fail
- value_string_as(Type)
- Same as for json_read/3.
This predicate is often used through validate_json_dict/3, which
mantains a cached mapping from the JSON Schema to Spec.