jsoncompat
JSON Schema compatibility checker for evolving schemas
What it is and what it does
jsoncompat is a Python binding for checking whether JSON Schemas remain compatible as they evolve, and for generating example values that satisfy a schema. It addresses the problem of schema versioning: when a schema changes over time, you need to know whether old data will still validate against the new schema (backward compatibility) or whether new data will validate against old schemas (forward compatibility). The package provides three main operations: compatibility checking between schema versions, validation of JSON instances against a schema, and generation of example values from a schema.
The package exposes a straightforward API: `check_compat()` takes two schemas and a role (serializer, deserializer, or both) and returns a boolean; `validator_for()` and `generator_for()` return reusable objects that parse the schema once and support repeated validation or generation. It also includes code generation for dataclasses that automatically handle serialization and deserialization with optional format support (JSON, YAML, MessagePack). No runtime dependencies are required for the core API.
Use it for:
- Verify that a new JSON Schema version remains backward compatible with old client data before deploying schema changes
- Generate valid test data that conforms to a schema for property-based testing or integration tests
- Validate incoming JSON payloads against a schema in an API or data pipeline
- Generate Python dataclasses from JSON Schemas with built-in validation and serialization
- Check forward compatibility when designing schemas that must accept data from multiple client versions
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Checks whether evolving JSON Schemas remain compatible and generates example values that conform to a schema.
Yes, if you need JSON Schema compatibility checking or example generation. The package is actively maintained, has no known vulnerabilities, and requires no external runtime dependencies. The main caveat is that license metadata is unclear in the fact sheet despite the description mentioning MIT—verify the actual license before use in proprietary contexts. Install friction is medium due to compiled wheels, but that is typical and not a blocker.
Install
jsoncompat on PyPI
pip
pip install jsoncompatuv
uv add jsoncompatpoetry
poetry add jsoncompatInstalling jsoncompat
Before you install
Medium install friction due to compiled wheels across multiple Python versions and platforms. Actively maintained with recent release history.
License in practice
License treatment is unclear; the description excerpt mentions MIT License but the fact sheet does not confirm SPDX or raw license metadata. Verify the actual license before use in proprietary or restricted contexts.
Quickstart
pip install jsoncompat==0.4.2
import jsoncompat as jsc
old_schema = '{"type": "string"}'
new_schema = '{"type": "number"}'
is_compatible = jsc.check_compat(old_schema, new_schema, jsc.Role.BOTH)
print(is_compatible)
Requires Python 3.12 or later.
Verify before relying
- Whether the MIT License mentioned in the description excerpt is the authoritative license for this package
- Performance characteristics when validating large or deeply nested schemas
- Whether the package handles all JSON Schema draft versions or only specific versions
Package facts
| License | not declared (unclear) |
| Python support | supports the current Python release (>=3.12) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 9 days since the last release |
| First released | |
| Downloads | 609,320/month — #5,773 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: jsoncompat-0.4.2-cp312-cp312-macosx_10_12_x86_64.whl; jsoncompat-0.4.2-cp312-cp312-macosx_11_0_arm64.whl; jsoncompat-0.4.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; jsoncompat-0.4.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; jsoncompat-0.4.2-cp312-cp312-musllinux_1_2_aarch64.whl; jsoncompat-0.4.2-cp312-cp312-musllinux_1_2_x86_64.whl; jsoncompat-0.4.2-cp312-cp312-win32.whl; jsoncompat-0.4.2-cp312-cp312-win_amd64.whl; jsoncompat-0.4.2-cp313-cp313-macosx_10_12_x86_64.whl; jsoncompat-0.4.2-cp313-cp313-macosx_11_0_arm64.whl; jsoncompat-0.4.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; jsoncompat-0.4.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; jsoncompat-0.4.2-cp313-cp313-musllinux_1_2_aarch64.whl; jsoncompat-0.4.2-cp313-cp313-musllinux_1_2_x86_64.whl; jsoncompat-0.4.2-cp313-cp313-win32.whl; jsoncompat-0.4.2-cp313-cp313-win_amd64.whl; jsoncompat-0.4.2-cp314-cp314-macosx_10_12_x86_64.whl; jsoncompat-0.4.2-cp314-cp314-macosx_11_0_arm64.whl; jsoncompat-0.4.2-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; jsoncompat-0.4.2-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
jsonschema-pydanticConverts JSON Schema definitions into Pydantic…
unclear · top 15,000 on PyPI
dataclasses-jsonschemaGenerates JSON Schema from Python dataclasses…
permissive · top 15,000 on PyPI
jsonschema-pydantic-converterConverts JSON Schema definitions to Pydantic v2…
permissive · top 15,000 on PyPI
trafaretTrafaret validates and transforms foreign data…
permissive · top 5,000 on PyPI
eidoValidates project metadata against PEP schemas…
permissive · top 15,000 on PyPI
kubernetes-validateValidates Kubernetes resource definitions…
permissive · top 15,000 on PyPI
datamodel-code-generatorGenerates Python data models (Pydantic,…
permissive · top 5,000 on PyPI
py-avro-schemaGenerates Apache Avro schemas from Python…
permissive · top 15,000 on PyPI
jsonaliasProvides a recursive type alias for…
permissive · top 5,000 on PyPI
gensonGenSON generates JSON Schema documents from…
permissive · top 5,000 on PyPI