Unexpected character ('}' (code 125))
Jackson quotes the character and its decimal code point, then says what it wanted instead. The second half of the message is the useful half: "was expecting double-quote to start field name" means it was waiting for the next key, which is what a trailing comma promises and does not deliver.
How the message appears
Jackson wording. The number in brackets is the decimal code point of the character it found, which is what makes these messages searchable but unreadable.
What causes it
(code 125) — a trailing comma before a closing brace
The comma said another member was coming; the closing brace arrived instead. Jackson reports the brace, so the message points one line past the comma that caused it.
(code 93) — a trailing comma inside an array
The same mistake inside an array. 93 is ].
(code 60) — the document is HTML
60 is <. An error page, a login redirect or a proxy response. No change to the JSON will help, because there is no JSON.
(code 39) — single quotes
39 is '. Valid in JavaScript and Python source, never in JSON.
The fix
Delete the comma before the closing } or ]. JSON permits a comma only between two values, never after the last one — which is exactly where a code generator or a hand edit tends to leave one.
{
"id": 7,
"tags": ["a", "b"],
}{
"id": 7,
"tags": ["a", "b"]
}The example travels in the URL fragment, which browsers never send to a server.
Worth knowing
- A quick decode of the codes you will actually see: 123
{, 125}, 91[, 93], 44,, 58:, 34", 39', 60<, 10 newline. - A very low code such as
(code 0)or(code 1)means you are parsing binary or a mis-decoded charset — check for a gzipped body being read as text, or a byte order mark.