protocol
json_schema_protocol
JSON Schema parser and validator protocol.
Availability:
logtalk_load(json_schema(loader))Author: Paulo Moura
Version: 1:0:0
Date: 2026-01-29
Compilation flags:
staticDependencies:
(none)
Remarks:
(none)
Inherited public predicates:
(none)
Public predicates
parse/2
Parses a JSON schema from the given source (file(Path), stream(Stream), codes(List), chars(List), or atom(Atom)) into a schema term.
Compilation flags:
staticTemplate:
parse(Source,Schema)Mode and number of proofs:
parse(++compound,--term) - one_or_errorvalidate/2
Validates a JSON term against a parsed schema. Succeeds if the JSON term is valid according to the schema.
Compilation flags:
staticTemplate:
validate(Schema,JSON)Mode and number of proofs:
validate(+term,+term) - zero_or_onevalidate/3
Validates a JSON term against a parsed schema. Returns a list of validation errors (empty list if valid).
Compilation flags:
staticTemplate:
validate(Schema,JSON,Errors)Mode and number of proofs:
validate(+term,+term,--list) - oneProtected predicates
(none)
Private predicates
(none)
Operators
(none)