Skip to content

Instantly share code, notes, and snippets.

@machisuji
Created April 2, 2012 04:57

Revisions

  1. machisuji created this gist Apr 2, 2012.
    8 changes: 8 additions & 0 deletions writes.scala
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    import play.api.libs.json._

    implicit object userToJson extends Writes[User] {
    def writes(user: User): JsonValue = JsonObject(Seq(
    "possiblyTotallyUnrelatedFieldName" -> JsString(user.name)
    //, ...
    ))
    }