I would like to provide a custom error message directly in the Read definition :
implicit val ar = (
(__ \ "firstName").read[String].customError(ValidationError("bad format", "firstName")) and
(__ \ "lastName").read[String] and
(__ \ "address").read[Address]
)(Employee)
is this possible ?
We don’t have a
mapErrorfacility yet inReads[T]orJsResult.The best way to do that is just to redefine your own Reads[String]