Given the following case class:
import java.time.LocalDate
case class ReportDateVO(reportDate: LocalDate)
I'm trying to define the implicit json format:
implicit val reportDatesWrite : Writes[ReportDateVO] = (
(JsPath \ "dt").write[LocalDate]
) (unlift(ReportDateVO.unapply))
But I get the following error:
overloaded method value write with alternatives: (t: java.time.LocalDate)(implicit w: play.api.libs.json.Writes[java.time.LocalDate])play.api.libs.json.OWrites[play.api.libs.json.JsValue] (implicit w: play.api.libs.json.Writes[java.time.LocalDate])play.api.libs.json.OWrites[java.time.LocalDate] cannot be applied to (fdic.ReportDateVO ⇒ java.time.LocalDate)
What are these alternatives? there's no default format? how to fix this? I'm using Play 2.5.2.