Created
March 6, 2013 08:37
-
-
Save andypetrella/5097673 to your computer and use it in GitHub Desktop.
Swithc to Play 2.1 in a quick and dirty fashion... at least for json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import play.api.libs.json._ | |
//this is crap but ease a lot the switch to play 2.1 | |
implicit def smashThat[A](js:JsResult[A]):A = js.recoverTotal { err => throw new RuntimeException(Json.stringify(JsError.toFlatJson(err))) } | |
val j = Json.obj("a"->1, "b"->2) | |
val m:Map[String, Int] = Json.fromJson[Map[String, Int]](j) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment