Search code examples
spray-json

Spray Json Deserialize Root Sequence


I want to deserialize a Json string which is a sequence at the root node. For example,

[{"name":"Bob", "age":26}, {"name":"Ted", "age":24}]

How do I use spray-json to do that?


Solution

  • I asked my unmarshaller to unmarshal the string as a Seq like -

    unmarshal[Seq[Person]]
    

    and it worked.