JSON Schema validation for Python, with full support for drafts 3 to 2020-12
open sourceMITfree
jsonschema is an implementation of the JSON Schema specification for Python, by Julian Berman. It validates JSON-like data against a schema with full support for drafts 2020-12, 2019-09, 7, 6, 4 and 3, can lazily report every validation error rather than stopping at the first, and lets you query which properties or items failed. Optional extras add the dependencies for format validation. The separate check-jsonschema tool runs it from the command line.
Problems it solves
- validate a JSON document against a JSON Schema in Python
- list every validation error in a JSON payload, not just the first
- check API request bodies against a schema in Python
Features
- full support for JSON Schema drafts 2020-12, 2019-09, 7, 6, 4 and 3
- lazy validation that reports every error
- programmatic querying of which properties or items failed
- optional format validation extras
Limitations
- format checks aren't enforced unless you turn them on, as the specification says, even with the format extras installed1
