What issues can jsonrepair fix?
mainThe library can repair a wide variety of common JSON syntax errors, including:
- Missing quotes around keys
- Missing escape characters
- Missing commas
- Missing closing brackets
- Truncated JSON
- Single quotes instead of double quotes
- Special quote characters (e.g.,
“...”) replaced with regular double quotes - Special whitespace characters replaced with regular spaces
- Python constants (
None,True,False) replaced withnull,true, andfalse - Trailing commas
- Comments (
/* ... */and// ...) - Fenced code blocks (
```json) - Ellipsis in arrays/objects (
[1, 2, 3, ...]) - JSONP notation (
callback({ ... })) - Escaped strings (e.g.,
{"stringified": "content"}) - MongoDB data types (
NumberLong(2),ISODate(...)) - Concatenated strings (
"a" + "b") - Newline delimited JSON (converting multiple objects into a valid JSON array)