Created
June 23, 2013 21:42
Generate JSON for a Phone case class as well as a Tuple. The Tuple contains a Sequence of our case class, as well as a count of the number of rows.
This file contains 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
implicit val phoneReads = Json.reads[Phone] | |
implicit val phoneWrites = Json.writes[Phone] | |
implicit val pageWrites = ( | |
(__ \ 'rows).write[Seq[Phone]] and | |
(__ \ 'count).write[Int] | |
).tupled : Writes[(Seq[Phone], Int)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment