currently this is what I could get
{
"friends": [438737,
12345,
32153,
53243
]
}
achievable by doing creating a case class
case class FriendsModel(uid: Option[String])
object FriendsModel {
implicit val paramsWrite = Json.writes[FriendsModel]
implicit val paramsRead = Json.reads[FriendsModel]
}
and basically adding the friendsModel to a List[FriendsModel] called friendList
and I could just Ok(Json.toJson(friendList))
Is there a way to insert variable as "friends" so my Json return would look like this:
{
"123654": [438737,
12345,
32153,
53243
]
}
where 123654 is my userid.
case class FriendsModel(uid: Option[MyCustomModel])