Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ryanpbrewster/7f3c1e9dec34808a34889345ab61e451 to your computer and use it in GitHub Desktop.
Save ryanpbrewster/7f3c1e9dec34808a34889345ab61e451 to your computer and use it in GitHub Desktop.
Writes[Person] for Working with JSON in Play 2.1 by Greg Methvin
import play.api.libs.json._
implicit val personFormat = Json.format[Person]
Json.toJson(Person(Some(1), "Arthur", "Dent", "[email protected]", new LocalDate("1952-03-11")))
// => {"id":1,"firstName":"Arthur","lastName":"Dent",birthDate":"1952-03-11"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment