I'm running into some odd issues with the output in JSON format from Claude Sonnet 4.5 suddenly the last few days. Here are two examples that fail to parse even with jaison.
I redacted the actual text of the JSON but retained the structure. The errors produced are identical with the full content of what Claude made.
{
"value1": true,
"value2": "short_string",
"content": [
"## MARKDOWN TEXT\nsome text.\",
"## MARKDOWN TEXT\nsome text."
],
"value3": false
}
The error from jaison is
Unexpected identifier "##" in value position. Only recognized constants (true, false, null, undefined, etc.) are allowed.
{
"value1": true,
"value2": "short_string",
"content": [
"## MARKDOWN TEXT\nsome text.\",
"value3": false
}
The error is
Unexpected identifier "value3" in value position. Only recognized constants (true, false, null, undefined, etc.) are allowed.
I'm not sure if it is possible to detect these. The second one is really broken badly but the first one I would hope could be fixed.
Given your proposed use case is to fix the stuff generated by LLMs that are not quite right, I submit these two in case you have any ideas how to deal with them. Thanks for sharing your project.
I'm running into some odd issues with the output in JSON format from Claude Sonnet 4.5 suddenly the last few days. Here are two examples that fail to parse even with jaison.
I redacted the actual text of the JSON but retained the structure. The errors produced are identical with the full content of what Claude made.
The error from jaison is
The error is
I'm not sure if it is possible to detect these. The second one is really broken badly but the first one I would hope could be fixed.
Given your proposed use case is to fix the stuff generated by LLMs that are not quite right, I submit these two in case you have any ideas how to deal with them. Thanks for sharing your project.