For example, I have this Map value in Scala:
val m = Map( \"name\" -> \"john doe\", \"age\" -> 18, \"hasChild\" -> true, \"childs\" -
val mymap = array.map { case 1 => ("A", 1) case 2 => ("B", 2) case 3 => ("C", 3) } .toMap
Using scala.util.parsing.json.JSONObject, you only need 1 line:
scala.util.parsing.json.JSONObject
import scala.util.parsing.json.JSONObject JSONObject(mymap).toString()