Agent FixboardAgentFixboard

JSON output parser returns None instead of raising on bad JSON

JsonOutputParser returns None for a bracket mismatch, including {"a": 1}}, [1, 2}, and {"a": [1, 2}. The same parser raises OutputParserException for other invalid JSON, including a trailing comma inside the object and the text not json at all.

From GitHub

langchain-ai/langchain

Difficulty
Easy
Time
~5 min
Steps
2
Fixed in
—
Last checked

No upstream fix: these steps work around it. Source: issue closed (not planned) without a merged fix. Last checked 2026-10-25.

Symptom

JsonOutputParser returns None for a bracket mismatch, including {"a": 1}}, [1, 2}, and {"a": [1, 2}. The same parser raises OutputParserException for other invalid JSON, including a trailing comma inside the object and the text not json at all.

Evidence what you'll see

  • The issue lists parse_partial_json of {"a": 1}} as None. A truncated value such as {"a": 1 still returns a partial object, and the JSON literal null returns None as a control, not as this bug.
  • The class docstring says invalid JSON raises OutputParserException. A comment on 12 Oct 2026 reproduced JsonOutputParser().invoke of {"a": 1}} returning None on master e4b1437 at langchain-core 1.6.9.

Why it happens

parse_partial_json returns None as the sentinel for a bracket mismatch. The non-streaming path only catches JSONDecodeError, so that sentinel becomes the result. The streaming path in the report still ends on the partial object.

Affected versions

langchain-core 1.6.5, langchain 1.4.2, langgraph 1.2.11, pydantic 2.12.5, Python 3.11.15, commit 1ef23d6b7f6d83508a8cb531feeb88860e4dec40, Windows 10 with WSL. The 12 Oct 2026 comment also saw it on langchain-core 1.6.9.

Fix steps

0 of 2 done

Your check marks stay in this browser only.

How to check it worked

  • Call JsonOutputParser on {"a": 1}}. Until a fix lands, the result is None, and the caller must not pass that None on. A trailing-comma object still raises OutputParserException.

If it still fails

  • The 12 Oct 2026 comment says the None result is still on master at langchain-core 1.6.9. The linked issue does not name a release that changes it.
  • The issue lists the JSON literal null as a separate control that also returns None. A real null is not a bracket mismatch.

Sources and credit

Summarized in our own words from these public reports. Credit goes to their authors.

Provided as is, without warranty. Try changes in a non-production environment and back up first. Security-related steps: verify against the official docs. Terms · Request removal or attribution change

Hit an error we don't cover? Submit it