mangiucugna / json_repair

A python module to repair invalid JSON, commonly used to parse the output of LLMs
https://pypi.org/project/json-repair/
MIT License
826 stars 48 forks source link

Infinite loop with open array and closed parent element #9

Closed mlxyz closed 10 months ago

mlxyz commented 10 months ago

Describe the bug The library runs into an infinite loop when calling repair_json('{foo: [}').

To Reproduce Steps to reproduce the behavior:

  1. Call repair_json('{foo: [}')

Expected behavior Output of fixed json: {foo: []}

Unfortunately, I don't have the time to create a PR so I just report the bug here.

mangiucugna commented 10 months ago

Thank you for reporting, I am releasing 0.4.4 right now with the fix.