JSON Schema Diff
schema.diff_json_schema
Overview
You send the old and the new version of a JSON Schema and we sort every difference into three buckets: breaking, non-breaking, and ambiguous. The yardstick is consumer-first backward compatibility — data written against the old schema should still validate against the new one. We look at type, required, properties, enum, the six size and range constraints, and additionalProperties, and every change comes back with the path where it happened. To check a payload against a schema, use schema.validate_json; to build a schema from sample data, use schema.infer_json_schema. Accepts file input via file_ref — no need to extract file content first.
Schemas keep moving, and the cost of a breaking change lands on whoever consumes your data. You get a deterministic verdict before you publish, instead of a support ticket afterwards.
Reliability
Deterministic: the same pair of schemas always yields the same diff in the same order. The verdict is consumer-first, so anything whose direction we cannot settle lands in ambiguous for you to judge. JSON_MALFORMED — trigger: one of the two schema documents is not parseable JSON; retryable: no, not as sent; next: run it through schema.repair_json, or fix the escaping, then call again. We also reject the call outright when a side has neither its inline field nor its file reference, when a schema is longer than 524288 characters, or when a referenced file is missing, unreadable, or over 5000000 bytes.
Context footprint
Each side accepts up to 524288 characters, inline or from a file reference; a file reference also saves you escaping JSON inside JSON. The response carries one small entry per change. A successful call costs 1 execution credit.
When to use it
Right before you publish a new version of a schema or an API contract, to see what the change does to existing consumers.
When you want to check data against a schema, merge two schemas together, or build a schema from sample documents.
Scope
Non-goals
- We never check a document against a schema — that is schema.validate_json
- We never merge the two schemas into a combined version
- We never follow a remote $ref or fetch anything from the network
Properties
Capabilities
Cost & billing
Flat rate per invocation
File handling
File limits
Constraints this skill applies to your input and generated files. The “Limited by” column shows the static source of each cap; none of these can be raised by upgrading your plan.
| Limit | Value | Limited by |
|---|---|---|
| Maximum size per input file | 4.8 MiB | Skill maximum |
How we handle your data
What this means
This skill may receive sensitive content, but it does not target sensitive data and returns only a structured non-sensitive result.
Squillify guarantees
- Runs inside Squillify
- This skill runs inside Squillify.
- Payloads are not sent to an external service by this skill.
- Squillify does not permanently store submitted payloads.
- Telemetry records metadata only, not submitted content.
- Submitted payloads are not used for training.
- Submitted payloads are not reviewed by humans.
- This skill does not target sensitive data.
- The response does not contain submitted content.
Your responsibility
Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.
Input schema
| Field | Type | Required | Description |
|---|---|---|---|
| oldSchema | string | No | Old schema as JSON text, 1 to 524288 characters. Required unless old_file_ref is provided. |
| old_file_ref | string | No | Tenant-owned old-schema file reference; omit it to read oldSchema. When both are sent this one wins. |
| newSchema | string | No | New schema as JSON text, 1 to 524288 characters. Required unless new_file_ref is provided. |
| new_file_ref | string | No | Tenant-owned new-schema file reference; omit it to read newSchema. When both are sent this one wins. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| compatible | boolean | Yes | True when the breaking list is empty. |
| breaking | array | Yes | Breaking changes, 0 through 10000 closed {path, changeType, description} objects that reject previously valid data. |
| nonBreaking | array | Yes | Non-breaking changes, 0 through 10000 closed {path, changeType, description} objects that old data survives. |
| ambiguous | array | Yes | Ambiguous changes, 0 through 10000 closed {path, changeType, description} objects whose impact depends on readers and writers. |
| totalChanges | integer | Yes | Breaking, non-breaking and ambiguous differences added up. |
API contract
POST /v1/executecurl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"schema.diff_json_schema","input":{"oldSchema":"{\"type\":\"object\"}","newSchema":"{\"type\":\"object\",\"properties\":{\"email\":{\"type\":\"string\"}}}"}}'import { Squillify } from "@squillify/sdk";
const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });
const { output } = await sq.execute("schema.diff_json_schema", {"oldSchema":"{\"type\":\"object\",\"properties\":{\"name\":{\"type\":\"string\"}},\"required\":[\"name\"]}","newSchema":"{\"type\":\"object\",\"properties\":{\"name\":{\"type\":\"string\"},\"email\":{\"type\":\"string\"}},\"required\":[\"name\"]}"});Errors
| Code | HTTP | Retryable | Description |
|---|---|---|---|
| VALIDATION_ERROR | 400 | No | The request payload failed schema validation. |
| UNAUTHORIZED | 401 | No | Missing or invalid API key. |
| SKILL_NOT_ACCESSIBLE | 403 | No | The API key is not granted access to this skill. |
| SKILL_NOT_AVAILABLE_FOR_PLAN | 403 | No | This skill is not included in your current plan. |
| PLAN_ELIGIBILITY_UNAVAILABLE | 503 | Yes | Plan eligibility could not be decided. Retry after backoff. |
| SKILL_NOT_FOUND | 404 | No | The requested skill or version does not exist. |
| TENANT_RATE_LIMITED | 429 | Yes | Request rate limit exceeded. Retry after backoff. |
| QUOTA_EXCEEDED | 429 | Yes | Plan quota exhausted. Retryable once the quota period resets. |
| EXECUTION_TIMEOUT | 504 | Yes | Execution exceeded the allowed time budget. |
| JSON_MALFORMED | 400 | No | The request payload failed this skill's input validation. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 KiB |
Limitations
- We never check a document against a schema — that is schema.validate_json
- We never merge the two schemas into a combined version
- We never follow a remote $ref or fetch anything from the network
- Validating data against a schema — use schema.validate_json
- Merging two schemas into one
- Inferring schemas from data — use schema.infer_json_schema
How to call
POST /v1/execute (requires authentication)
{
"skillKey": "schema.diff_json_schema",
"input": {
"oldSchema": "{\"type\":\"object\",\"properties\":{\"name\":{\"type\":\"string\"}},\"required\":[\"name\"]}",
"newSchema": "{\"type\":\"object\",\"properties\":{\"name\":{\"type\":\"string\"},\"email\":{\"type\":\"string\"}},\"required\":[\"name\"]}"
}
}Examples
Non-breaking change: add optional field
{
"oldSchema": "{\"type\":\"object\",\"properties\":{\"name\":{\"type\":\"string\"}},\"required\":[\"name\"]}",
"newSchema": "{\"type\":\"object\",\"properties\":{\"name\":{\"type\":\"string\"},\"email\":{\"type\":\"string\"}},\"required\":[\"name\"]}"
}{
"ambiguous": [],
"totalChanges": 1,
"nonBreaking": [
{
"path": "/properties/email",
"changeType": "property_added_optional",
"description": "New optional property 'email' added"
}
],
"compatible": true,
"breaking": []
}Breaking change: property type change
{
"oldSchema": "{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"integer\"}},\"required\":[\"id\"]}",
"newSchema": "{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"string\"}},\"required\":[\"id\"]}"
}{
"ambiguous": [],
"totalChanges": 1,
"nonBreaking": [],
"compatible": false,
"breaking": [
{
"path": "/properties/id/",
"changeType": "type_changed",
"description": "Type changed from \"integer\" to \"string\""
}
]
}Recommended use cases
- API contract compatibility checks during schema evolution
- CI/CD gates that block deployments on breaking changes
- Schema version review before publishing updated contracts
Avoid for
- Validating data against a schema — use schema.validate_json
- Merging two schemas into one
- Inferring schemas from data — use schema.infer_json_schema
Related skills
Composable with
Safety & privacy
- Runs without calling any external service.
- Your payloads are never stored permanently.
- Telemetry captures metadata only — never your payload contents.
- We never train models on your payloads.
- No human reviews your payloads.