WelliSolutions / HugeJsonViewer

Viewer for JSON files that can be GBs large.
MIT License
279 stars 18 forks source link

Possibly Mal-formed JSON, only opened first item. #23

Open afarlie opened 1 year ago

afarlie commented 1 year ago

Describe the bug

When opening a potentially mal-formed JOSN in which each line of the file consists of an object bounded by { } delimiters but no comma as a line terminator, the viewer only opened the first item present in the file.

To Reproduce (using minimal example)

Create a JSON consisting of the following :

{object_id:"1" , type:"event", channel:"2"}
{object_id:"2" , type:"event", channel:"2"}

Each item is on it's own line, but there are no commas between the {} delimited items or as a line terminator.

Open the file in HugeJosnViewer

Expected behaviour

Viewer should display each item it found individually.

Desktop (please complete the following information:

Additional context I was wanting to use the viewer to filter search a specfic data file generated from an activity log file in a Discord personal data package, which contains JSON style data in a possibly mal-formed format.

WelliSolutions commented 1 year ago

I'd expect the viewer not to open the file at all and give an error message that it's not valid JSON.

afarlie commented 1 year ago

See also Issue 12 - https://github.com/WelliSolutions/HugeJsonViewer/issues/12 about newline delimited JSON which I suspect is the situation here. I use the term mal-formed because I wasn't sure the newline delimited format was proper JOSN.

What would be nice is a way of converting the newline delimited form into something which is readable.

Alternatively do you have a more detailed technical explanation stating why the newline delimited form isn't JOSN, so I can file an appropriately worded bug ticket with Discord?

WelliSolutions commented 2 weeks ago

Newline separated data still parses the first object, even after upgrading to Newtonsoft JSON version 13.