The following code produces a List[JsonAst.JObject]:
val json = recommendations.map { r =>
("cardId" -> r._1) ~
("count" -> r._2)
}
This one doesn't. It produces List[(String, Int)]:
val json = recommendations.map { r =>
(r._1.toString -> r._2)
}
How can I convert this List[(Int, Int)] into JSON?