Skip to content

Instantly share code, notes, and snippets.

@andypetrella
Created March 6, 2013 08:37
Show Gist options
  • Save andypetrella/5097673 to your computer and use it in GitHub Desktop.
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
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