jiter icon indicating copy to clipboard operation
jiter copied to clipboard

json-cat support (aka lax JSON lines support)

Open samuelcolvin opened this issue 1 year ago • 0 comments

I just made it up, but it's a superset of JSON lines that ignores whitespace and instead just parses concatenated JSON things. source of idea

So the following would be valid:

{
  "foo": 1,
  "bar": 2
}
{"spam":  4}{"eggs": 5}["ham"]

Advantages:

  • more expressive (each item can be pretty)
  • tiny space saving - if you choose not to insert the newlines
  • it should be easier for jiter to support - the actual JSON parsing logic doesn't need to change at all as far as I know
  • json-lines should be valid json-cat

I really don't think there's much more to it than that.

samuelcolvin avatar May 03 '24 08:05 samuelcolvin