JSON · 7 min read

A Quality Assurance Pass for Every JSON Payload

Five checks — validity, counts, exact numbers, shape, and no silent fixes — that turn a quick paste into a real inspection before your payload ships.

Every developer has done it: paste a JSON payload into a viewer, scroll for ten seconds, spot some familiar keys and plausible-looking numbers, and call it reviewed. That is not quality assurance — it is pattern recognition. A payload can be perfectly valid JSON and still be wrong. An array can arrive one item short, a price can lose its precision, a key can be stated twice with the second value quietly overwriting the first. None of that stops the payload from parsing, so none of it is caught by the question developers actually ask: "does it parse?"

The fix is a repeatable checklist, run the same way every time, backed by a tool that reports facts instead of vibes. The JSON Inspector on routineza is built for exactly that: strict parsing, live value counts, a tree view of structure, and a guarantee that it never edits your text behind your back. Below is the five-check pass we recommend before any payload ships.

Why "it parses" is not a quality gate

JSON parsers are deliberately permissive. The specification allows numbers in exponential notation, keys in any order, whitespace almost anywhere, and — in the wild — many parsers accept duplicate keys without complaint, resolving them last-one-wins. Validity, in other words, is a low bar: a payload clears it the moment it has matching braces and legal tokens, and it can clear that bar while carrying a data bug straight into production.

Consider what "valid" does not tell you: whether the array has the number of items the sender intended, whether that ID survived the trip without being rounded, whether null here means "no value", "unknown", or "someone cleared this field". Those are correctness questions, and correctness is what QA is for. Each check below takes seconds, but together they cover the failure modes eyeballing reliably misses.

The five-check pass

Check 1: Strict validity — including duplicate keys

Start with the hardest gate: does the payload parse when duplicate keys are treated as errors rather than silently merged? A key stated twice is a bug, not a default — when two writers disagree about a field, most runtimes keep whichever value came last, turning a merge conflict into silent data loss:

{
  "role": "viewer",
  "role": "admin"
}

Parsed strictly, this fails loudly — which is what you want in a QA pass. If the inspector reports a duplicate key, fix the payload at the source — never by "accepting the last one". Also look for less visible problems: a stray byte-order mark, a control character pasted from a log file, or a leftover trailing comma — all fatal to a strict parser and invisible to a casual scroll.

Check 2: Value counts — did the array lose items?

Once the payload parses, the inspector's status line tells you exactly how many values it contains, and the tree shows how they are distributed. Use it to answer the question QA actually cares about: is the count what you expected? An order export with 412 lines should not arrive as an array of 411, and a paginated endpoint that promised 50 records should not return 37 objects. Counts drift for boring reasons — a filtered query, a truncated response — but every missing item is data your downstream code will never see.

Also compare declared counts against actual ones: if the payload carries itemCount or total, verify it against the real array length in the tree. A mismatch means the count is stale or the array is incomplete, and either way the payload needs an explanation before it ships.

Check 3: Exact numbers — read the raw tokens

Numbers are where valid JSON goes quietly wrong. Two visually different tokens can parse to the same value, and two visually identical tokens can behave differently on opposite sides of a language boundary. Scan the raw text for the usual suspects:

1e3                 // parses as 1000 — is a compact exponent what the producer meant?
19.990000           // trailing zeros: numerically identical to 19.99, but suspicious to see
9007199254740993    // one past 2^53: JavaScript rounds this to ...992 on contact

Exponential notation is legal but often unintended; when you see 1e3, ask why the producer emitted it. Trailing zeros do not change the value, but they hint at string formatting upstream. The serious risk is integers beyond 2^53: any ID larger than 9,007,199,254,740,991 gets silently rounded the moment it touches a JavaScript number, so a payload that parses correctly can arrive with IDs that no longer match the database. If you see long numeric IDs, verify they stay under the limit or travel as strings — our guide on safe integers and 2^53 covers the details.

Check 4: Shape — depth and lengths at a glance

Switch to the Tree tab. Structure problems nearly invisible in raw text become obvious as a picture: nesting depth, the length of every array, and which values are objects versus lists. You are checking the payload's skeleton against the contract, not its contents. Does the response nest data inside result exactly one level deep, the way the client expects? Is items an array, or did someone ship an object keyed by SKU?

Two shape traps deserve special attention. First, empty containers: [] and {} both mean "nothing here", but they are different types, and an API expecting an array misbehaves when handed an object. Our guide on empty arrays versus empty objects walks through that distinction. Second, the three kinds of nothing: null, an empty string, and a missing key all look similar in raw text but mean different things to consumers. The null versus empty versus missing guide covers how to tell them apart and when each is appropriate.

Check 5: No silent fixes — what you see is what parses

The final check is about the tool itself. Some editors "helpfully" normalize what you paste: trimming whitespace, reformatting numbers, sorting keys, or repairing quotes. That is poison for QA: after normalization you are no longer looking at the payload that will travel over the wire, only a tidied version of it. The JSON Inspector does none of that. It never rewrites your text; formatting, whitespace, and number tokens appear in the output exactly as they arrived in the input. When you fix a problem in Check 3 by replacing 1e3 with 1000, the change happens because you typed it — not because the tool decided you probably meant that.

This also makes the pass repeatable: a tool that silently edits its input produces different results for different people, while a tool that does not makes the checklist deterministic. If what you see parses, that is what parses.

A worked scenario: one payload through all five checks

Suppose a vendor sends an order payload that you will forward to a billing system. It parses fine in a browser console, so someone proposes shipping it as-is. Run the pass instead:

{
  "orderId": 9007199254740993,
  "customer": {
    "id": 4821,
    "tier": "gold",
    "tier": "silver"
  },
  "items": [
    { "sku": "TS-04", "qty": 2, "unitPrice": 19.990000 },
    { "sku": "MX-11", "qty": 1, "unitPrice": 1e3 }
  ],
  "itemCount": 3,
  "coupon": null,
  "attachments": {},
  "notes": ""
}

Check 1 fails immediately: tier appears twice inside customer, and the customer's loyalty tier depends on which value a parser happens to keep. That alone blocks it. Continuing anyway, Check 2 finds that itemCount claims 3 while the tree shows items with a length of 2 — one line item vanished somewhere upstream. Check 3 flags three things: orderId is one past 2^53 and will round down in any JavaScript consumer; 1e3 evaluates to 1000 for an item the price list says costs 100.00; and the trailing zeros on 19.990000 hint at string formatting upstream. Check 4 shows attachments as an empty object where the billing API expects an array, and coupon as null where a missing key would be more honest. Check 5 is the reassurance that every finding above reflects the vendor's actual bytes — the inspector changed nothing.

The corrected payload looks like this:

{
  "orderId": "9007199254740993",
  "customer": {
    "id": 4821,
    "tier": "gold"
  },
  "items": [
    { "sku": "TS-04", "qty": 2, "unitPrice": 19.99 },
    { "sku": "MX-11", "qty": 1, "unitPrice": 100.00 },
    { "sku": "KB-77", "qty": 1, "unitPrice": 45.50 }
  ],
  "itemCount": 3,
  "coupon": "WELCOME10",
  "attachments": [],
  "notes": "Leave at front desk"
}

Same schema, same intent — but now the ID survives the trip, the count agrees with the array, and nothing is left to a parser's discretion. Five checks, a couple of minutes, one conversation with the vendor instead of one incident report after launch.

The pass at a glance

CheckWhat it catches
1. Strict validitySyntax errors, duplicate keys, stray control characters, trailing commas
2. Value countsTruncated arrays, stale count fields, pagination that returns less than promised
3. Exact numbersUnintended exponent notation, suspicious trailing zeros, IDs past 2^53 that JavaScript rounds
4. ShapeWrong nesting depth, objects where arrays are expected, the three kinds of "nothing" used interchangeably
5. No silent fixesAny gap between what you reviewed and what will actually parse

Folding the pass into code review and release checklists

A checklist only works if it lives where the decisions happen. In code review, treat a changed payload like changed code: paste the new fixture into the inspector and run the five checks before approving. Reviewers who would never approve a function change without running tests should not approve a payload change from a diff either — diffs hide duplicate keys and count drift well, since the eye follows added and removed lines rather than the structure of the whole.

In release checklists, make the pass a named step rather than a habit. "Payload QA: run the five checks on every request fixture and every vendor response sample" is a step a new team member can execute on their first day; "make sure the JSON looks right" is not. The same applies to vendor integrations: when a third party changes their export format, run their sample payload through the pass before writing glue code — Check 1 and Check 4 will tell you within minutes whether that "simple format change" moved an array or duplicated keys.

Any data that crosses a boundary — service to service, vendor to platform, export to import — deserves the same treatment: parse it strictly, count it, read its numbers as raw tokens, look at its shape, and confirm that nothing along the way fixed it for you. Validity is what the parser grants; correctness is what you verify. The JSON Inspector makes the second part a two-minute job, which is how often it should be done.

Reproduce every example locally with the JSON Inspector or the matching tool on the workbench. Nothing you paste leaves your browser.