Skip to main content

Squillify development is paused indefinitely. Read why, and discover what this experiment achieved. Read the story

MicroSkills Reference

Compare Payload to Schema

schema.compare_payload_to_schema

ProductionEngine wrapper (Class A)Deterministicverifiablefastv1.0.0
No network

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

Note
We take one payload and one schema and tell you, deviation by deviation, how far apart they are — classified, located, and counted by category.

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

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

analysisvalidation

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call1 credit

File handling

Accepts file_refProduces file_refMax input1.9 MB

How we handle your data

Sensitive input, safe output
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.

Read the Microskill Data Handling Policy

Input schema

FieldTypeRequiredDescription
payloadobjectYesJSON object actually received; extra keys are payload fields and values may be nested objects, arrays, scalars or null. — unconstrained RFC 8259 JSON items.
schemaobjectYesJSON Schema the payload was supposed to match, with local $ref only and at most 4096 properties. — unconstrained RFC 8259 JSON items.
draftstringNoDialect to compile with: draft-07, 2019-09 or 2020-12; omit it for 2020-12.
modestringNoHow harshly to grade unexpected fields and format violations: strict, permissive or reportOnly. Omit it for reportOnly.
maxFindingsintegerNoHow many findings to return, 1 through 1000; omit it for 1000.

Output schema

FieldTypeRequiredDescription
validbooleanYesTrue when the payload satisfies the schema with zero deviations.
driftDetectedbooleanYesTrue as soon as at least one finding was produced.
summaryobjectYesClosed counts covering total, missingRequired, unexpectedFields, typeMismatches, enumMismatches and constraintViolations.
findingsarrayYesDeviations sorted by path then type, 0 through 1000 closed objects.

API contract

POST /v1/execute
curl
curl -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}}'
Integrations
TypeScript SDK
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

CodeHTTPRetryableDescription
VALIDATION_ERROR400NoThe request payload failed schema validation.
UNAUTHORIZED401NoMissing or invalid API key.
SKILL_NOT_ACCESSIBLE403NoThe API key is not granted access to this skill.
SKILL_NOT_AVAILABLE_FOR_PLAN403NoThis skill is not included in your current plan.
PLAN_ELIGIBILITY_UNAVAILABLE503YesPlan eligibility could not be decided. Retry after backoff.
SKILL_NOT_FOUND404NoThe requested skill or version does not exist.
TENANT_RATE_LIMITED429YesRequest rate limit exceeded. Retry after backoff.
QUOTA_EXCEEDED429YesPlan quota exhausted. Retryable once the quota period resets.
EXECUTION_TIMEOUT504YesExecution exceeded the allowed time budget.

Other limits

LimitValue
Recommended inline bytes32 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)

Request bodyjson
{
  "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

Inputjson
{
  "payload": {
    "email": "[email protected]",
    "customerId": "8842"
  },
  "schema": {
    "properties": {
      "email": {
        "type": "string"
      },
      "customerId": {
        "type": "integer"
      }
    },
    "type": "object",
    "required": [
      "customerId",
      "email"
    ]
  }
}
Expected outputjson
{
  "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

Inputjson
{
  "schema": {
    "properties": {
      "email": {
        "type": "string"
      },
      "customerId": {
        "type": "integer"
      }
    },
    "type": "object",
    "required": [
      "customerId",
      "email"
    ]
  },
  "mode": "strict",
  "payload": {
    "email": "[email protected]",
    "customerId": 8842
  }
}
Expected outputjson
{
  "valid": true,
  "summary": {
    "constraintViolations": 0,
    "total": 0,
    "missingRequired": 0,
    "unexpectedFields": 0,
    "typeMismatches": 0,
    "enumMismatches": 0
  },
  "findings": [],
  "driftDetected": false
}
  • 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)

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.

Tags

schemajsonvalidation