Invalid JSON can break APIs, webhooks, ETL jobs, and config loading in seconds...
Start by isolating the smallest failing sample and test it in JSON Fixer.
Example 1: unquoted key + trailing comma
{name: "Alice", "age": 30,}
Fix:
{"name":"Alice","age":30}
Example 2: single quotes and missing comma
{'region':'eu-west-1' 'retry':3}
Fix:
{"region":"eu-west-1","retry":3}
Do not stop at “valid”
{"status":"ok","count":"12"}
Syntax can pass while semantics still fail. Always validate expected types.
Production repair sequence
Real incident patterns
JavaScript pasted as JSON:
{userId: 42, role: 'admin'}
Log contamination:
INFO payload={"ok":true}
Prevention
- Never hand-concatenate JSON
- Validate in CI
- Keep known-good fixtures
- Format before review
Before / After
Before:
{"user": {id: 5, "roles": ["admin",], "meta": {"active": true,}}, "env": "prod",}
After:
{"user":{"id":5,"roles":["admin"],"meta":{"active":true}},"env":"prod"}
FAQ
Can invalid JSON look correct?
Yes. Most errors are single-character issues.
Fastest workflow?
Fixer → Validator → Formatter.