Skip to main content

Validate JSON

Check JSON: that it is well written, that the paths you need are there and, if you give one, that it follows a JSON Schema.

Command in the JSON toolkit · id ooa.json/validate · 9 inputs, 3 outputs

Inputs​

InputTypeRequiredDefaultWhat it is
JSONAnyNoJSON text, Dictionary or List to check (or use a file or a session).
Required keysListNoPaths that must exist, e.g. ["id", "customer.email"].
SchemaAnyNoJSON Schema (draft-07 to 2020-12) as a Dictionary or JSON text; $ref may point inside it, to another file (with schema_path or an $id) or to a URL.
Schema pathFileNoJSON Schema file; used when 'schema' is empty. References such as address.json#/$defs/x are read from its folder.
Check formatsBooleanNotrueCheck the format keyword: date-time, date, time, duration, email, hostname, ipv4, ipv6, uri, uuid, regex and json-pointer.
Load remote refsBooleanNotrueFollow $ref to other schema files and http(s) URLs (30 s timeout, 5 MB limit); false allows references inside the schema only.
PathFileNoJSON file to check (instead of json).
Required typesDictionaryNoPaths that must exist with a type: String, Number, Boolean, List, Dictionary or Null.
SessionStringNoCheck the document of this JSON session (Start session).

Outputs​

OutputTypeWhat it is
validBooleanTrue when the JSON parses and every required path exists.
errorsListProblems found, each with the path where it was found.
levelStringWhat was checked: syntax (the text did not parse), structure or schema.