I need to add a static value to a case class I'm building from JSON with Play framework. I can add a constant value like this:
implicit val userRead: Reads[UserInfo] = (
Reads.pure(-1L) and
(JsPath \ "firstName").readNullable[String] and
(JsPath \ "lastName").readNullable[String]
)(UserInfo.apply _)
But I can't see how I could pass a variable into the implicit Reads at the time it is called. I'm pretty new to Scala so probably missing something obvious?