What json representation of (String, String)
do you expect it to be?
If it is something like this:
yourListName : {
"1" : "2",
"3" : "4"
}
then you could just use Json.toJson(list.toMap)
. Otherwise, you must define a Writes
for a (String, String)
like this:
implicit val writer = new Writes[(String, String)] {
def writes(c: (String, String)): JsValue = {
Json.obj("something" -> c._1 + ", " + c._2)
//or like this:
//Json.obj(c._1 -> c._2)
}
}
Be sure to have this writer in scope