--- id: jsoncompat version: "0.4.2" license: unclear license_treatment: unclear maintenance: active --- # jsoncompat — JSON Schema compatibility checker for evolving schemas License: unclear · Maintenance: active · Downloads: 609.3K/mo ## 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 above — 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 pip install jsoncompat uv add jsoncompat poetry add jsoncompat ## Installing 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_current - Install friction: medium - Maintenance: active - Downloads: 609.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags json schema compatibility checker, schema evolution validation, generate json examples from schema, backwards compatible json schemas, json schema validator generator, json-schema, schema-validation, code-generation [View on SkillFed](https://skillfed.io/packages/jsoncompat) · [View on PyPI](https://pypi.org/project/jsoncompat/)