Broken example
{ name: "Ada" }
Corrected example
{ "name": "Ada" }
Why this error happens
JSON is strict. Object keys must be in double quotes, strings must use double quotes, and comments are not allowed. When a parser sees something like name without quotes, it throws an unexpected token error.
How to fix it
- Look near the character or token mentioned in the error.
- Check for single quotes, comments, missing quotes, or a trailing comma.
- Validate the repaired payload again.
- Format the fixed JSON so the structure is easier to read.