How to write a Play JSON writes converter for a case class with a single nullable member
问题 In Play 2.3, I have a case class with a single optional double member: case class SomeClass(foo: Option[Double]) I need a JSON write converter that handles the member as nullable: implicit val someClassWrite: Writes[SomeClass] = ??? The Play docs provide an example: case class DisplayName(name:String) implicit val displayNameWrite: Writes[DisplayName] = Writes { (displayName: DisplayName) => JsString(displayName.name) } But sadly I can't figure out how to do this for 1) a single nullable and