API Reference
jsonschema
An implementation of JSON Schema validation for Python, supporting draft 2020-12 and earlier versions.
Official Documentation ↗CompatibilityThis documentation covers version
v4.21. Check the official docs for the latest API surface.Installation
pip
pip install jsonschemaMethods
No methods match this filter.
jsonschema validates instances against schema documents and reports precise error paths.
Key Features
- Multiple JSON Schema drafts
- Detailed ValidationError messages
- Format and custom validator support
Usage Notes
Pin a version and check the official docs for the API surface you depend on before upgrading.
Errors
The following points are quoted verbatim from the official documentation. 来源:https://python-jsonschema.readthedocs.io/ · 取证方式:HTTP GET 官方 README/文档页(HTML 去标签) · 抓取时间:2026-11-07T13:50:36.315Z. Any error type, throw condition or recovery step not stated there is left unspecified; this page does not infer exception classes or return values.
- ValidationError : ‘Invalid’ is not of type ‘number’ It can also be used from the command line by installing check-jsonschema . (https://python-jsonschema.readthedocs.io/)
- Features ¶ Full support for Draft 2020-12 , Draft 2019-09 , Draft 7 , Draft 6 , Draft 4 and Draft 3 Lazy validation that can iteratively report all validation errors. (https://python-jsonschema.readthedocs.io/)
- If you don’t have all of the versions that jsonschema is tested under, you’ll likely want to run using nox ’s –no-error-on-missing-interpreters option. (https://python-jsonschema.readthedocs.io/)
FAQ
- Which draft should I target?
- Use Draft 2020-12 for new schemas via the matching validator class; older drafts remain supported for compatibility.
- How do I get all errors?
- Iterate iter_errors instead of calling validate, which stops at the first failure and discards the rest.
- Are formats like email checked by default?
- Format checking is opt-in through a format checker; without it, format keywords are annotations only.
Report a problem with this API docOpens a pre-filled issue on GitHub.