/usr/lib/swipl/library/ext/json/json_schema.pl
All Application Manual Name SummaryHelp

  • ext
    • json
      • json.pl -- Reading and writing JSON serialization
      • json_grammar.pl
      • json_rpc_server.pl
      • json_schema.pl -- JSON Schema reader and validator
        • json_validate/3
        • json_compile_schema/3
        • json_check/3
      • json_rpc_common.pl
      • json_rpc_client.pl -- JSON RPC client
      • json_convert.pl -- Convert between JSON terms and Prolog application terms
 json_check(+Spec, ?JSON, +Options) is semidet
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.