Lax Syntax
JSON relies on a strict syntax, and parsers typically fail at the first syntax error. Some parsers, especially in HTML contexts, adopt a more lenient approach with preference to capturing as much data as possible. In most cases, we will try to recover from common syntax errors, but annotate them with warnings to promote resolution and broad client-compatibility.
Examples
The source contained invalid syntax that we ignored (block comment), but the original may be problematic for other clients.
The source contained invalid syntax that we ignored (line comment), but the original may be problematic for other clients.
The source contained invalid syntax that we ignored (invalid literal; e.g. "TRUE" -> "true"), but the original may be problematic for other clients.
The source contained invalid syntax that we ignored (leading zero), but the original may be problematic for other clients.
The source contained invalid syntax that we ignored (invalid escape; e.g. "\\ " -> "\\ "), but the original may be problematic for other clients.
The source contained invalid syntax that we ignored (missing escape; e.g. "\n" -> "\\n"), but the original may be problematic for other clients.
The source contained invalid syntax that we ignored (invalid Unicode; e.g. "\\uD800" -> "\\uFFFD"), but the original may be problematic for other clients.
The source contained invalid syntax that we ignored (extra comma), but the original may be problematic for other clients.
The source contained an object with a duplicate key, so some data was ignored.