I try to parse a JSON string with the net.liftweb.util.JSONParser. It’s parse() method returns a Box[Any] value which I want to process via pattern matching like this:
JSONParser.parse("{foo: 'xxx', bar: 'yyy'}") match {
case Full(Map) => println("ok")
case x => println(x)
}
I’d expect this code to print “ok” but instead it prints
Full(Map(foo -> xxx, bar -> yyy))
Does anyone have an idea what’s wrong with my statement?
Updated:
(I had forgotten the Full() around the Map[,]
I don’t know your requirements, but Lift also has a another json library which is more powerful than JSONParser, it is called lift-json