Assert JSON Equals
quality.assert_json_equals
Overview
You give us the value you expected and the one you got, and we tell you exactly where they part company — one finding per spot, each with a JSON pointer you can read. You decide what counts as equal: whether key order matters, whether array order matters, how much numeric drift you tolerate, whether a null is the same as a missing key, which paths to skip entirely, and which paths only have to look like a UUID or a timestamp rather than match. Nothing is guessed and nothing is repaired, so the same pair always produces the same answer.
A test that asks a model whether two payloads look the same gives you a different answer on a bad day, and a plain equality check gives you "not equal" without telling you where.
Reliability
The same pair and the same options always give the same findings, in the same order, and nothing leaves the platform. Two behaviours are worth knowing. A path in ignoredPaths or dynamicPathRules has to match exactly — it is not a prefix, so "/items" does not cover "/items/0/id" — and an ignored path takes everything beneath it with it. And when maxMismatches is reached we stop walking, so both the list and the counts in summary are incomplete; _meta.truncated tells you when that happened, and raising maxMismatches gives you the rest. Unequal values are a normal successful answer, not a failure. Two failures do stop the call, both because the options need fixing rather than the data — INVALID_JSON_POINTER means a path in ignoredPaths or dynamicPathRules is not a JSON pointer, so write "" for the root or start it with a slash, and DYNAMIC_RULE_UNSUPPORTED means a rule name is not one of uuid, iso_datetime, non_empty_string, integer, number, or any. Both name the offending value, and retrying unchanged will fail identically.
Context footprint
The reply grows with the number of differences, and each one carries both values by default — set includeValues false, or lower maxMismatches, when the payloads are large. A successful call costs 1 execution credit.
When to use it
When you need a yes or no on two JSON values, plus the reason when it is no.
When the value needs validating against a schema or fixing before it parses.
Scope
Non-goals
- Does not repair or reformat either value before comparing
- Does not check either value against a schema
- Does not judge whether two different values mean the same thing
- Does not coerce types the way JavaScript would, so 1 never equals "1"
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 |
|---|---|---|---|
| expected | object | Yes | JSON value you expected — object, array, string, number, boolean or null; a string is parsed as JSON when it can be. |
| actual | object | Yes | JSON value you actually got, in the same shapes as expected; reporting is from this value's point of view. |
| options | object | No | Closed equality rules covering key order, array order, numbers, nulls, ignored pointers, dynamic path rules, mismatch cap and whether values are echoed; omit the object for the published defaults. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| equal | boolean | Yes | True when mismatches came back empty under the chosen rules. |
| mismatches | array | Yes | Differences in walk order, 0 through 1000 closed objects with code and path. |
| summary | object | Yes | Closed counts of every difference found, including those beyond maxMismatches: missing, unexpected, different and ignored. |
| _meta | object | Yes | Closed bookkeeping with the comparison profile name and whether the walk stopped at maxMismatches. |
API contract
POST /v1/executecurl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"quality.assert_json_equals","input":{"expected":{"a":1},"actual":{"a":1}}}'import { Squillify } from "@squillify/sdk";
const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });
const { output } = await sq.execute("quality.assert_json_equals", {"actual":{"total":11},"expected":{"total":10}});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. |
| INVALID_JSON_POINTER | 400 | No | The request payload failed this skill's input validation. |
| DYNAMIC_RULE_UNSUPPORTED | 400 | No | The skill does not support the requested variant. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 KiB |
Limitations
- Does not repair or reformat either value before comparing
- Does not check either value against a schema
- Does not judge whether two different values mean the same thing
- Does not coerce types the way JavaScript would, so 1 never equals "1"
- Fixing JSON that will not parse
- Checking a payload against a schema
How to call
POST /v1/execute (requires authentication)
{
"skillKey": "quality.assert_json_equals",
"input": {
"actual": {
"total": 11
},
"expected": {
"total": 10
}
}
}Examples
One number is off, and the report says by how much
{
"actual": {
"total": 11
},
"expected": {
"total": 10
}
}{
"equal": false,
"mismatches": [
{
"details": {
"info": "difference=1"
},
"actual": 11,
"path": "/total",
"code": "VALUE_MISMATCH",
"expected": 10
}
],
"summary": {
"missing": 0,
"unexpected": 0,
"different": 1,
"ignored": 0
},
"_meta": {
"truncated": false,
"comparisonProfile": "json-equality-1"
}
}Two values that match exactly
{
"actual": {
"a": 1
},
"expected": {
"a": 1
}
}{
"equal": true,
"mismatches": [],
"summary": {
"missing": 0,
"unexpected": 0,
"different": 0,
"ignored": 0
},
"_meta": {
"truncated": false,
"comparisonProfile": "json-equality-1"
}
}Recommended use cases
- Check an API response matches what your test expects
- Compare two payloads while letting ids and timestamps vary
- Confirm a transformation changed only what it was meant to change
Avoid for
- Fixing JSON that will not parse
- Checking a payload against a 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.