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

encodeJsonArrayPipeline produces incorrect JSON when stream is empty #972

Open
disordered opened this issue Jun 26, 2023 · 0 comments
Open

Comments

@disordered
Copy link

disordered commented Jun 26, 2023

As the title says, encodeJsonArrayPipeline results in invalid JSON object if ZStream is empty.

This code, for example:

ZStream.from(List())
  .via(zio.json.JsonEncoder[String].encodeJsonArrayPipeline)
  .run(ZSink.mkString)

produces the value ]. Expected value is [].

ZStream version 2.0.12
ZIO-json version 0.5.0

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