Skip to content

Instantly share code, notes, and snippets.

@francisdb
Created September 6, 2013 23:02
Show Gist options
  • Save francisdb/6471158 to your computer and use it in GitHub Desktop.
Save francisdb/6471158 to your computer and use it in GitHub Desktop.
Anorm + play json
implicit val pkWrites = new Writes[Pk[Long]] {
def writes(pk: Pk[Long]): JsValue = {
pk.toOption match {
case Some(value) => JsNumber(value)
case None => JsNull // TODO check if correct
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment