Skip to main content
Getly

Guides & Tutorials

The Envelope Rule — a field guide to validating JSON that arrives wrapped

Why validate(body) and validate({data: body}) can disagree, and the corpus that finds every way they do.

$12.99

Product Description

A field guide for engineers who accept JSON from other systems and get burned by it. THE RULE: a validator's verdict must be a property of the document, not of the envelope that carried it. If validate(body) and validate({"data": body}) can disagree, you are validating transports, and you will fail the day a client changes its mind about wrapping. WHAT IS IN IT: the five ways an envelope changes a verdict -- duplicate keys, the UTF-8 BOM that survives an lstrip() fix, canonical-digest mismatch, an advertised error-code list that is not the returned one, and a catch block that returns valid because the parser threw. Each with the check that closes it. WHY IT IS WORTH BUYING: the defect class is measured, not alleged. Against a real implementation, 9 of 13 test payloads gave DIFFERENT verdicts between the two envelopes, 7 of them malformed documents accepted as valid in one and rejected in the other. A passing smoke test would have shipped all seven. The BOM case is the one that comes back after its own fix, one byte narrower. WHAT YOU GET: the written guide, the twelve-document corpus it describes as a runnable test file, the wrapper-invariant harness (one assertion, under a second), and the canonical re-serialisation recipe for digest comparison. Runs offline, no account, no network, no keys. Licence: commercial.

What you get

1 file · 6.2 KB

  • envelope-rule-guide-95d001a9.jsonJSON · 6.2 KB
LicenceCommercial use allowed
PublishedSep 27, 2026
File size6.2 KB
File formatJSON
Versionv1.0

Tags

jsonvalidationapiengineeringguidereference
E
Endurance SB

Frequently asked questions

Do I get access instantly?

Yes. This is a digital product - you can download it right after checkout, straight from your library.

Can I use it for commercial projects?

Yes. Commercial use is allowed: use it in your own business and in things you sell. You may not resell or redistribute the file itself.

What's your refund policy?

You're covered by a 30-day money-back guarantee. If something isn't right, request a refund from your order and the Getly team reviews it.

What file formats and sizes will I get?

You'll download 1 file - JSON - 6.2 KB in total.

Do I get free updates?

Yes - when the seller ships a new version, you can re-download the latest files from your library at no extra cost. Check the changelog for recent updates.

Price

$12.99