The content before the last quote in JSON is considered the last value in the JSON. The quote is not added after the last value in a JSON if there is another last quote " present in the content.
Can be forced to produce the expected behavior in my case by replacing the { with {" and } with "}.
How to reproduce
This:
json_repair.loads('```json{\n"response": "Hello something ... "Some Thing" is something. ...\n}\n```')
is parsed into:
{'response': 'Hello something ... "Some Thing'}
Expected behavior
This:
json_repair.loads('```json{\n"response": "Hello something ... "Some Thing" is something. ...\n}\n```')
should be parsed into:
{'response': 'Hello something ... "Some Thing" is something. ...'}
Version of the library
0.29.7
Describe the bug
The content before the last quote in JSON is considered the last value in the JSON. The quote is not added after the last value in a JSON if there is another last quote
"
present in the content.Can be forced to produce the expected behavior in my case by replacing the
{
with{"
and}
with"}
.How to reproduce
This:
json_repair.loads('```json{\n"response": "Hello something ... "Some Thing" is something. ...\n}\n```')
is parsed into:{'response': 'Hello something ... "Some Thing'}
Expected behavior
This:
json_repair.loads('```json{\n"response": "Hello something ... "Some Thing" is something. ...\n}\n```')
should be parsed into:{'response': 'Hello something ... "Some Thing" is something. ...'}
which will happen if the the
}
is replaced by"}
.