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

[api] Support x-json-stream, add JsonGenerator writeNewLine() #339

Open
rbygrave opened this issue Dec 9, 2021 · 0 comments
Open

[api] Support x-json-stream, add JsonGenerator writeNewLine() #339

rbygrave opened this issue Dec 9, 2021 · 0 comments

Comments

@rbygrave
Copy link

rbygrave commented Dec 9, 2021

Reference: https://en.wikipedia.org/wiki/JSON_streaming#Line-delimited_JSON

When looking at JsonGenerator API I do not see a mechanism to support x-json-stream type output using the "Line delimited JSON" format. Is there a way to produce it that I am missing? Otherwise, I would like to discuss and see if that would be something we could look to add?

Background:

I have traditionally been using jackson core JsonGenerator which includes a writeRaw(char) method that I can use to write the new line character.

In general for x-json-stream "line delimited JSON" we need to:

  1. Ensuring "pretty" printing JSON is disabled / turned off
  2. Write \n characters after each top level json object

Ideally I would like to see support for producing this via the JsonGenerator API. I believe that would mean adding a method to JsonGenerator like writeNewLine().

@lukasj lukasj transferred this issue from eclipse-ee4j/parsson Dec 9, 2021
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