playframework/playframework — pull request #3521 by kutchar (2014-10-17 19:30:22+00:00)
Title: OptionReads should validate JSON value if it exists

Currently OptionReads delegates to format.reads without checking if the value exists and ignores the error returned by the format.

Say I have:
`case class User(name: Option[String])`

Then `{ "name": "Drew" }` is a valid JSON, so is `{ }`, but `{ "name": 12 }` is not. Currently, OptionReads will return None when reading `{ "name": 12 }` instead of an error.