Mysterious chunking behaviour when using Akka HTTP

Hi everyone! When using chunked encoding I notice that I’m getting a chunk of len(1) as the first chunk. It could of course be something I’m doing, but I wasn’t expecting this. Any ideas? My test code:

test("client") {
    JsObject("subscriptions" -> JsArray(JsObject("topic" -> JsString(topic1))))
  ) ~> MyHttpRoutes() ~> check {
    status == StatusCodes.OK
    contentType ==> ContentTypes.`application/json`

    val firstDataChunk = chunksStream
      .drop(1) // FIXME: Understand why this must be dropped - there's an element with a len of 1 - is this just the way chunked encoding works?
      .runWith(Sink.head) ==> JsObject(
        "key"       -> JsNumber(1),
        "offset"    -> JsNumber(0),
        "partition" -> JsNumber(0),
        "topic"     -> JsString(ns + ":" + topic1),
        "value"     -> JsString(data1.encodeBase64.toString())

Thanks in advance!

I worked it out. :-) JSON was being returned as an array. The first chunk was the start of array marker ("[").

Switching to JSON lines output as described here works just fine.