Registry / data / check-jsonschema

check-jsonschema

JSON →
library0.38.0pypypi✓ verified 26d ago

check-jsonschema is a command-line interface (CLI) tool and pre-commit hook for validating JSON/YAML files against JSON schemas. It provides a convenient way to integrate schema validation into development workflows, supporting a wide range of common configuration schemas. The current version is 0.37.1, and it releases frequently to update vendored schemas and add new features.

pip install check-jsonschema
INSTALL
IMPORT
SIG · CHECK-JSONSCHEMA
C
check-jsonschema
datapythonv0.38.0
Install
Import
Disk
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.38.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
1/2 runs
1/2 runs
py 3.11
1/2 runs
1/2 runs
py 3.12
1/2 runs
1/2 runs
py 3.13
1/2 runs
1/2 runs
py 3.9
1/2 runs
1/2 runs
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

main
from check_jsonschema import main
from check_jsonschema.main import main

The primary use of check-jsonschema is through its command-line interface or as a pre-commit hook. First, define your JSON schema and the data you wish to validate. Then, run the `check-jsonschema` command specifying the schema and data files. For automated checks, configure it in your `.pre-commit-config.yaml` file, using its built-in hooks for common configuration files or a custom hook for your own schemas.

# 1. Create a schema file (e.g., 'my_schema.json') # echo '{"type": "object", "properties": {"name": {"type": "string"}}, "required": ["name"]}' > my_schema.json # 2. Create a data file to validate (e.g., 'my_data.json') # echo '{"name": "John Doe"}' > my_data.json # 3. Run validation via CLI # check-jsonschema --schema my_schema.json my_data.json # 4. Integrate with pre-commit (add to .pre-commit-config.yaml) # - repo: https://github.com/python-jsonschema/check-jsonschema # rev: '0.37.1' # hooks: # - id: check-dependabot # - id: check-github-workflows
check-jsonschema --version
Debug
Known issues
breakingPython 3.9 support has been dropped.
fix
Ensure your environment uses Python 3.10 or newer. Upgrade your Python version or pin check-jsonschema to a version prior to 0.37.0 if Python 3.9 is required.
affects: >=0.37.0
breakingVerbose output levels for the CLI have changed. Previously, `-v` showed checked filenames; now, `-v` shows all errors without filenames, and `-vv` (or higher) is required to display filenames checked.
fix
If you relied on `-v` to see filenames, adjust your scripts or commands to use `-vv` instead for that output.
affects: >=0.37.0
gotchaWhen using check-jsonschema as a pre-commit hook with custom schemas, ensure the schema paths are correct relative to the repository root or accessible via defined `$schema` IDs. Incorrect paths or unreachable references will lead to validation errors.
fix
Verify that your `pre-commit` hook configuration correctly points to schemas, especially if they are not vendored. Use the `--schema` argument with a correct relative path if validating against a local schema, or ensure your schema's `$id` is properly set up for external resolution.
affects: all
gotchacheck-jsonschema defaults to validating against vendored schemas for common config types (e.g., GitHub Workflows, Dependabot). If you have a custom schema with the same filename or an unconventional path, it might be ignored or validated against the wrong schema.
fix
Always explicitly specify your custom schema using `--schema your-custom-schema.json` if it's not one of the vendored types or if you need to override the default. For `pre-commit` hooks, configure a specific hook to point to your custom schema.
affects: all
Upgrade
Version history
0.38.0latest on PyPI · released Aug 9, 2026
Audit
Dependencies
jsonschemarequiredCore dependency for schema validation logic.
Agent activity
30 hits · last 30 days
node
26
OpenAI (training)
1
Resources
check-jsonschema — pip install check-jsonschema · libregistry