I have the following JSON:
[{"id_str":"67979542","name":"account"}, {"id_str":"12345678","name":"account2"}, {"id_str":"3423423423","name":"account3"}]
which has been parsed into a play.api.libs.json.JsArray object with 3 elements.
I want to parse this JsArray into my a custom object Group
with the following code:
case class Group(id: String, name: String)
implicit val twitterGroupReads: Reads[Group] = (
(JsPath \\ "id_str").read[String] and
(JsPath \\ "name").read[String]
)(Group.apply _)
But I don't know how to use the library to get all the elements from the array and parse those into my custom object.