Compare Payload to Schema
schema.compare_payload_to_schema
Overview
You send a JSON payload and the JSON Schema it was supposed to match. We validate it and turn every deviation into a classified finding — missing required field, type mismatch, enum mismatch, unexpected field, format violation, or other constraint violation — each with a JSON Pointer, the schema keyword that failed, and a severity. You also get counts per category so you can tell a one-field typo from a broken contract. To compare two schemas with each other, use schema.diff_json_schema instead.
A plain validation verdict tells you something broke but not what changed. You get the shape of the drift: which paths, which keywords, how severe, how many.
Reliability
Deterministic: the same payload, schema, draft and mode always give the same findings in the same order. We reject the call, and retrying unchanged will not help, when payload is absent, when schema is absent or not an object, when draft is anything other than draft-07, 2019-09 or 2020-12, when mode is anything other than strict, permissive or reportOnly, when maxFindings falls outside 1 to 1000, or when the schema itself will not compile. Correct the offending input, then call again.
Context footprint
You get six counts plus at most maxFindings findings, so the response stays small even when the payload is large. A successful call costs 1 execution credit.
When to use it
When a payload and its contract disagree and you need the difference spelled out before you decide who fixes what.
When you want to compare two schema versions with each other, or when a simple pass or fail verdict is all you need.
Powered by the battle-tested networknt JSON Schema engine, covering draft-07, 2019-09 and 2020-12.
Scope
Non-goals
- We never repair or reshape your payload — you decide what to change
- We never fetch a schema for you; send it inline with the request
- We never compare two schemas with each other
Properties
Capabilities
Cost & billing
Flat rate per invocation
File handling
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 |
|---|---|---|---|
| payload | object | Yes | JSON object actually received; extra keys are payload fields and values may be nested objects, arrays, scalars or null. — unconstrained RFC 8259 JSON items. |
| schema | object | Yes | JSON Schema the payload was supposed to match, with local $ref only and at most 4096 properties. — unconstrained RFC 8259 JSON items. |
| draft | string | No | Dialect to compile with: draft-07, 2019-09 or 2020-12; omit it for 2020-12. |
| mode | string | No | How harshly to grade unexpected fields and format violations: strict, permissive or reportOnly. Omit it for reportOnly. |
| maxFindings | integer | No | How many findings to return, 1 through 1000; omit it for 1000. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| valid | boolean | Yes | True when the payload satisfies the schema with zero deviations. |
| driftDetected | boolean | Yes | True as soon as at least one finding was produced. |
| summary | object | Yes | Closed counts covering total, missingRequired, unexpectedFields, typeMismatches, enumMismatches and constraintViolations. |
| findings | array | Yes | Deviations sorted by path then type, 0 through 1000 closed objects. |
API contract
POST /v1/executecurl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"schema.compare_payload_to_schema","input":{"payload":{"customerId":"8842"},"schema":{"type":"object","properties":{"customerId":{"type":"integer"}},"required":["customerId"]},"draft":"2020-12","mode":"strict","maxFindings":50}}'import { Squillify } from "@squillify/sdk";
const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });
const { output } = await sq.execute("schema.compare_payload_to_schema", {"payload":{"email":"[email protected]","customerId":"8842"},"schema":{"properties":{"email":{"type":"string"},"customerId":{"type":"integer"}},"type":"object","required":["customerId","email"]}});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. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 KiB |
Limitations
- We never repair or reshape your payload — you decide what to change
- We never fetch a schema for you; send it inline with the request
- We never compare two schemas with each other
- Comparing two schema versions with each other (schema.diff_json_schema)
- A plain pass or fail answer with no classification (schema.validate_json)
- Checking presence of mandatory fields only (schema.check_required_fields)
How to call
POST /v1/execute (requires authentication)
{
"skillKey": "schema.compare_payload_to_schema",
"input": {
"payload": {
"email": "[email protected]",
"customerId": "8842"
},
"schema": {
"properties": {
"email": {
"type": "string"
},
"customerId": {
"type": "integer"
}
},
"type": "object",
"required": [
"customerId",
"email"
]
}
}
}Examples
Customer id arrived as a string
{
"payload": {
"email": "[email protected]",
"customerId": "8842"
},
"schema": {
"properties": {
"email": {
"type": "string"
},
"customerId": {
"type": "integer"
}
},
"type": "object",
"required": [
"customerId",
"email"
]
}
}{
"valid": false,
"summary": {
"constraintViolations": 0,
"total": 1,
"missingRequired": 0,
"unexpectedFields": 0,
"typeMismatches": 1,
"enumMismatches": 0
},
"findings": [
{
"keyword": "type",
"path": "/customerId",
"type": "TYPE_MISMATCH",
"severity": "breaking",
"message": "string found, integer expected"
}
],
"driftDetected": true
}Payload matches the contract cleanly
{
"schema": {
"properties": {
"email": {
"type": "string"
},
"customerId": {
"type": "integer"
}
},
"type": "object",
"required": [
"customerId",
"email"
]
},
"mode": "strict",
"payload": {
"email": "[email protected]",
"customerId": 8842
}
}{
"valid": true,
"summary": {
"constraintViolations": 0,
"total": 0,
"missingRequired": 0,
"unexpectedFields": 0,
"typeMismatches": 0,
"enumMismatches": 0
},
"findings": [],
"driftDetected": false
}Recommended use cases
- Find out which fields drifted after a partner changed their API response
- Explain to a caller why their request body was rejected, field by field
- Compare what a producer emits against what a consumer expects to receive
Avoid for
- Comparing two schema versions with each other (schema.diff_json_schema)
- A plain pass or fail answer with no classification (schema.validate_json)
- Checking presence of mandatory fields only (schema.check_required_fields)
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.