title: "Expected List as JsArray" when posting to an akka-http server
body: <p>I'm attempting to create a slight variation of the Orders/Items application here:
  <a href="https://github.com/akka/akka-http/blob/master/docs/src/test/scala/docs/http/scaladsl/SprayJsonExampleSpec.scala#L51" rel="nofollow noreferrer">https://github.com/akka/akka-http/blob/master/docs/src/test/scala/docs/http/scaladsl/SprayJsonExampleSpec.scala#L51</a></p>
  
  <p>I'm connecting to the server using httpie, the command is:</p>
  
  <pre><code>http POST http://localhost:8080/post_an_order items=[]
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>HTTP/1.1 400 Bad Request
  Content-Length: 73
  Content-Type: text/plain; charset=UTF-8
  Date: Wed, 08 Feb 2017 19:04:37 GMT
  Server: akka-http/10.0.3
  
  The request content was malformed:
  Expected List as JsArray, but got "[]"
  </code></pre>
  
  <p>The code is:</p>
  
  <pre><code>import akka.actor.ActorSystem
  import akka.stream.ActorMaterializer
  import akka.http.scaladsl.Http
  import akka.http.scaladsl.server.Directives._
  import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._
  import spray.json.DefaultJsonProtocol._
  import scala.io.StdIn
  
  case class Item(id: Long, name: String)
  case class Order(items: List[Item])
  
  object WebServer {
    implicit val system = ActorSystem()
    implicit val materializer = ActorMaterializer()
    implicit val executionContext = system.dispatcher
  
    implicit val itemFormat = jsonFormat2(Item)
    implicit val orderFormat = jsonFormat1(Order)
  
    def main(args: Array[String]) {
      val route =
        get {
          pathSingleSlash {
            complete( Item(123, "DefaultItem") )
          }
        } ~
        post {
          path("post_an_order") {
            entity(as[Order]) { order =&gt;
              val itemsCount = order.items.size
              val itemNames = order.items.map(_.name).mkString(", ")
              complete(s"Ordered $itemsCount items: $itemNames")
            }
          }
        }
  
      val bindingFuture = Http().bindAndHandle(route, "localhost", 8080)
  
      println("http://localhost:8080/")
  
      StdIn.readLine()
      bindingFuture.flatMap( _.unbind() ).onComplete( _ =&gt; system.terminate() )
    }
  }
  </code></pre>