Imagine you have a Map[String, List[String]] that looks like this:
val myMap = Map(
"ab" -> List("yo", "yo2", "yo3"),
"cd" -> List("hi", "hi1", "hi2")
)
if we do Json.toJson(myMap), the resulting JSON is
{
"ab" : ["yo", "yo2", "yo3"],
"cd" : ["hi", "hi1", "hi2"]
}
Is there a way we could get the outer container to be an array instead of an object? Like
[
"ab" : ["yo", "yo2", "yo3"],
"cd" : ["hi", "hi1", "hi2"]
]
I'm not sure that this would be valid Json. Thanks.