JSON Schema Diff & Breaking Change Detector
Compare two JSON Schema versions and identify added, removed, and modified fields, type changes, constraint changes, required-field changes, and potential breaking changes.
Inbound requests: Validates whether payloads that previously passed client validation continue to be accepted by the new schema.
Property 'currency' is now required. Payloads missing this field will fail validation.
Incompatible type change from 'integer' to 'string'.
Values must conform to semantic format 'uuid'. Note that format assertion depends on dialect configuration.
Enum value 'USD' added.
Enum value 'EUR' added.
Enum value 'GBP' added.
Documentation attribute 'default' modified without altering structural instance validation.
Enum value 'cancelled' was removed.
Property 'trackingNumber' removed from schema definition under an open schema. Payloads with this property will still be accepted as additional properties.
Optional property 'notes' added to schema.
Documentation attribute 'title' modified without altering structural instance validation.
How to Use
1. What is a JSON Schema Diff?
A JSON Schema Diff is a specialized semantic comparison tool that evaluates two versions of a JSON Schema contract (such as an existing production release vs. a proposed draft) to detect additions, deletions, type shifts, constraint alterations, and backward-incompatible breaking changes.
Unlike a conventional JSON diff—which merely checks whether static data values differ—a JSON Schema diff evaluates the rules of validation. It asks: "Will existing JSON payloads that were valid under Schema Version 1 still pass validation under Schema Version 2?"
2. Why Compare JSON Schema Versions?
Prevent Production Outages
Detect accidental breaking changes (like narrowing maximum string lengths or adding required keys) before shipping code to production.
Accurate SemVer Bumping
Automatically determine whether your changes require a MAJOR (breaking), MINOR (feature), or PATCH (metadata) version release.
Automated Migration Guides
Generate ready-to-publish Markdown release notes and consumer remediation guides to streamline client upgrades.
3. What is a Breaking Schema Change?
| Modification Type | Classification | Consumer Impact |
|---|---|---|
| Added to "required" array | BREAKING | Existing payloads without this property immediately fail validation. |
| Removed property from schema | BREAKING | Consumers expecting to read this property will receive undefined. |
| Type changed (e.g. integer → string) | BREAKING | Type mismatch rejects existing numeric payloads. |
| Enum variant removed | BREAKING | Instances with the removed enum literal fail schema checks. |
| Added optional property | COMPATIBLE | Existing payloads remain fully valid. |
| maximum bound increased (50 → 100) | COMPATIBLE | Expands accepted value range without invalidating smaller values. |
4. Consumption Perspectives (Consumer vs Producer Rules)
Compatibility is not universal—it depends on whether you are analyzing the schema from the perspective of an API Consumer, an API Producer, an Event Consumer, or a Configuration Consumer.
Evaluates incoming requests sent by clients. Narrowing constraints (e.g. lowering maxLength) or adding required fields breaks consumers.
Evaluates responses returned by the server. Removing properties, widening return types, or adding enum variants may break client deserializers that rely on strict schemas or exhaustive pattern matching.
Evaluates event-driven message feeds and webhooks. Removing fields or widening event types can break downstream consumers processing historical or live event streams.
Evaluates configuration files (e.g. Kubernetes manifests or app configs). Adding required keys or tightening validation rules causes existing valid configuration files to fail validation on deployment.
5. Data Type Changes & Narrowing vs. Widening
When a property's type keyword changes, the engine inspects primitive compatibility:
- Incompatible Mutations:
integer → string,string → integer,object → arrayare classified as BREAKING. - Subtype Widening:
integer → numberis backward-compatible for consumers because all integers are mathematically valid numbers. Conversely,number → integernarrows accepted values and is BREAKING. - Nullable Widening:
string → [string, null]expands the valid set to allow nulls (NON-BREAKING for consumers). - Nullable Narrowing:
[string, null] → stringremoves null support (BREAKING).
6. Required Property Additions and Removals
The required array defines mandatory properties for valid JSON objects:
Adding a property to the required list immediately invalidates all existing payloads that do not supply this key.
Removing a property from the required array relaxes validation rules, allowing payloads with or without the field.
7. Enum and Value Set Evolution
The enum keyword specifies an exhaustive list of acceptable literal values:
- Enum Value Removed: Removing a literal (e.g.
"cancelled") is BREAKING because any database record or consumer payload using that value will fail validation. - Enum Value Added: Adding a literal is NON-BREAKING for consumers, but flagged as POTENTIALLY BREAKING for producers if downstream clients employ strict switch statements.
8. Numeric, String, and Array Constraint Modifications
| Keyword | Change Direction | Classification |
|---|---|---|
| minimum | 0 → 10 (Increased bound) | BREAKING |
| maximum | 100 → 50 (Decreased bound) | BREAKING |
| maxLength | 100 → 50 (Narrowed limit) | BREAKING |
| minItems | 0 → 3 (Increased minimum) | BREAKING |
| additionalProperties | true → false (Strict object enforcement) | BREAKING |
9. $ref Pointers and allOf / oneOf / anyOf Composition
The diff engine resolves local reference pointers (#/$defs/... and #/definitions/...) with cycle detection to evaluate real schema inheritance:
- oneOf Variant Removed: Removing an allowed union schema variant is BREAKING.
- anyOf Variant Added: Adding an alternative branch is NON-BREAKING.
- allOf Branch Added: Adding an intersecting constraint is POTENTIALLY BREAKING.
10. Compatibility Score & Semantic Versioning (SemVer)
ToolMono computes a deterministic 0–100 Compatibility Score:
Based on detected changes and current version numbers, the engine recommends:
- MAJOR bump (e.g. 2.0.0): When 1 or more breaking changes exist.
- MINOR bump (e.g. 1.5.0): When only backward-compatible additions exist.
- PATCH bump (e.g. 1.4.1): When only metadata or documentation attributes changed.
11. Generating Automated Changelogs & Migration Guides
With one click, export automated documentation:
Categorized release notes grouped into Breaking Changes, Potentially Breaking Changes, Non-Breaking Additions, and Documentation.
Actionable step-by-step remediation advice explaining exact property paths and code adjustments required by consumers.
12. Step-by-Step Practical Diff Example
Comparing an API order schema transition:
{
"type": "object",
"required": ["id"],
"properties": {
"id": { "type": "integer" }
}
}{
"type": "object",
"required": ["id", "email"],
"properties": {
"id": { "type": "string" },
"email": { "type": "string" }
}
}Findings generated:
$.properties.id.type: Type changed fromintegertostring(BREAKING).$.required: Property'email'is now required (BREAKING).- Recommendation: Increment MAJOR version to v2.0.0.
13. Real-World API, Event, and Webhook Use Cases
Block PRs that introduce unversioned breaking schema changes in automated CI pipelines.
Verify Kafka, RabbitMQ, and webhook event schema backwards-compatibility across microservices.
Preview consumer impact before regenerating client SDKs from updated schema models.
14. 100% Client-Side Privacy Guarantee
All schema comparisons, recursive diff algorithms, and document generations run locally in your web browser memory. No proprietary schema contracts or configuration files are uploaded to remote servers.
15. Authoritative References & Standards
Consult official standards from the JSON Schema Organization and SemVer:
JSON Schema Specification (Draft 2020-12)
Authoritative specification for the 2020-12 JSON Schema dialect.
Semantic Versioning 2.0.0 Specification
Authoritative standard for API and schema version numbers and breaking changes.
RFC 6902: JavaScript Object Notation (JSON) Patch
IETF standard for atomic JSON document transformation patches.
JSON Schema Validation Specification (2020-12)
Official vocabulary definitions for structural validation keywords.
16. Frequently Asked Questions (20 FAQs)
Related Tools
Browse all toolsJSON Schema Validator
Validate JSON data against a JSON Schema online with detailed errors, JSON paths, draft detection, and browser-based processing.
JSON Schema Generator
Instantly generate JSON Schema from any JSON payload. Supports Draft 7 and Draft 2020-12 with fast, browser-based processing.
JSON Diff Checker
Compare two JSON files or objects online and find structural differences instantly. Detect added, removed, and modified values with nested key paths in your browser.
JSON Formatter
Free online JSON formatter, beautifier, and validator. Format, indent, minify, and inspect JSON with real-time syntax error detection in your browser. 100% client-side.
JSON Transformer
Free online multi-engine JSON transformer. Filter, reshape, map, and restructure complex JSON payloads using JavaScript, jq, JSONPath, and Jolt specifications with 100% client-side Web Worker execution, live preview, and Monaco editors.
OpenAPI Diff Checker
Compare two versions of an OpenAPI or Swagger specification to see what changed and understand the potential impact on existing API clients. Review endpoints, parameters, request bodies, response schemas, and security requirements in a structured report.
OpenAPI Validator
Validate, lint, and audit OpenAPI 3.2, 3.1, 3.0 and Swagger 2.0 specifications in JSON or YAML. Detect syntax errors, broken $ref pointers, path issues, security vulnerabilities, and API design warnings in your browser.
OpenAPI Mock Generator
Generate realistic mock API responses from OpenAPI and Swagger specifications. Select an endpoint and response status, resolve schemas and $ref references, customize mock data, and export ready-to-use mock fixtures or server code entirely in your browser.