josdejong / svelte-jsoneditor

A web-based tool to view, edit, format, repair, query, transform, and validate JSON
https://jsoneditoronline.org
Other
820 stars 108 forks source link

Do not throw a wrong format error #268

Closed Hikaru67 closed 1 year ago

Hikaru67 commented 1 year ago

If a attribute have empty value like that { "lt": "nginx", "url":, "cl": 123 }, the attribute "url" will be removed and formatted normally instead of throwing error and pointing where is the problem. I think it should be a better if throw error in this case.

josdejong commented 1 year ago

Thanks for reporting, the parser should indeed throw an error in case of a missing value. (an empty value can be represented using null)

josdejong commented 1 year ago

See https://github.com/josdejong/lossless-json/issues/247

josdejong commented 1 year ago

This has been fixed now in the lossless-json library, and in the web application https://jsoneditoronline.org.