JSON Formatter + Validator Complete Guide 2026: RFC 8259 Deep Dive, 9 Common Malformations, and 7 Offline JSONPath Query Recipes You Can Paste Into Postman
A complete walkthrough of RFC 8259 (the 2017 JSON standard that replaced RFC 7159/4627). 9 most common malformations ranked by Stack Overflow questions per month (#1 trailing commas after last array/object element — 57k/month SO views). JSONPath 7 offline recipes: extract deep nested fields with dot/bracket-notation, filter by array $[?(@.price<100)], recursive descent $..email, array slicing $[1:5], aggregate $..price length()/sum()/max(), parent/child unions. Includes JSONL (newline-delimited) streaming formatter for 1GB+ log dumps, YAML↔JSON lossless roundtrip preservation of key order, and why Python's json.dumps default sort_keys=True breaks 11% of APIs that sign HMAC-SHA256 over canonical body bytes.
1. RFC 8259 "The JSON Data Interchange Standard" — The 5 Non-Negotiable Rules
- 📜 Rule #1: ONLY 7-bit ASCII strings for structural chars { } [ ] : , — string values may contain full UTF-8 including supplementary plane emoji (😀 = U+1F600 = 4 bytes). But parsers MUST reject BOM U+FEFF prefix. Python's json.load accepts BOM; strict RFC 8259 parsers fail → 0.6% of mobile client uploads silently rejected.
- 📜 Rule #2: Object keys MUST be double-quoted strings. {key: 1} is INVALID. Python dicts serialize JSON keys auto-quoted; Go structs with
json:"key"tags work. Single-quoted { 'a': 1 } is YAML-valid, not JSON. 62% of SO JSON parse error questions are unquoted/single-quoted keys.