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

JsonFraming does not accept multiple top-level arrays #26098

Closed
shkoder opened this issue Dec 10, 2018 · 1 comment
Projects
Milestone

Comments

@shkoder
Copy link
Contributor

@shkoder shkoder commented Dec 10, 2018

    "parse multiple arrays" in {
      val input1 =
        """
          |[
          | { "name" : "john" }
          |]
          |""".stripMargin

      val input2 =
        """
          |[
          | { "name" : "jack" }
          |]
          |""".stripMargin

      val result = Source(List(ByteString(input1), ByteString(input2)))
        .via(JsonFraming.objectScanner(Int.MaxValue))
        .runFold(Seq.empty[String]) {
          case (acc, entry) ⇒ acc ++ Seq(entry.utf8String)
        }

      result.futureValue shouldBe Seq(
        """{ "name" : "john" }""",
        """{ "name" : "jack" }"""
      )
    }

gives

List("{ "name" : "john" }") was not equal to List("{ "name" : "john" }", "{ "name" : "jack" }")
@johanandren

This comment has been minimized.

Copy link
Member

@johanandren johanandren commented Sep 25, 2019

Reopening issue until backport has been merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
4 participants
You can’t perform that action at this time.