I have a JSON string, say:
val json = JSONObject(Map("a" -> 1)).toString()
I want to convert this json to map again. I tried:
val map = json.toMap[String, Int]
This gives me the following error:
Error:(46, 25) Cannot prove that Char <:< (String, Int).
val map = json.toMap[String, Int]
^
Error:(46, 25) not enough arguments for method toMap: (implicit ev: <:<[Char,(String, Int)])scala.collection.immutable.Map[String,Int].
Unspecified value parameter ev.
val map = json.toMap[String, Int]
^
What is the correct way of doing this?