I have this String :
"[[{\"cfunction\":\"sum\"},{\"cfunction\":\"groupBy\"}],[{\"cfunction\":\"Add Here\"}]]";
Which is generated by :
val json2 = List(List(("cfunction" -> "sum"), ("cfunction" -> "groupBy")), List(("cfunction" -> "Add Here")))
println(compact(render(json2)))
How to generate : "[[{\"cfunction\":\"sum\" , \"1\":\"1\"},{\"cfunction\":\"groupBy\" , \"2\":\"2\"}],[{\"cfunction\":\"Add Here\"}]]"; ?
I've tried :
val json2 = List(List(("cfunction" -> "sum" , "1" -> "1"), ("cfunction" -> "groupBy", "2" -> "2")), List(("cfunction" -> "Add Here")))
But this causes compiler error :
type mismatch; found : List[List[(java.io.Serializable, java.io.Serializable)]] required: org.json4s.JValue (which expands to) org.json4s.JsonAST.JValue