I want to convert a simple JSON string such as {\"Name\":\"abc\", \"age\":10} to the corresponding JSON object (not a custom Scala object such as \"Person\"). D
{\"Name\":\"abc\", \"age\":10}
The parseFull returns in-terms of Some(Map), parseRaw returns in terms of Some(JSONObject)
parseFull
Some(Map)
parseRaw
Some(JSONObject)
import scala.util.parsing.json._ val parsed = JSON.parseRaw("""{"Name":"abc", "age":10}""").getOrElse(yourDefault)
parsed is the JSONObject
parsed