Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

json-cat support (aka lax JSON lines support) #89

Open
samuelcolvin opened this issue May 3, 2024 · 0 comments
Open

json-cat support (aka lax JSON lines support) #89

samuelcolvin opened this issue May 3, 2024 · 0 comments

Comments

@samuelcolvin
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant