I have the following Reads object:
implicit val branchRead: Reads[BranchApplyRequest] = (
(JsPath \ "act").read[String] and
(JsPath \ "st").read[String] and
(JsPath \ "nts").read[String] and
(JsPath \ "bk").read[Int]
) (BranchApplyRequest.apply _)
The problem is that when one of these fields doesn't come from the browser, I get an exception and the program fails. Ideally, the non present field will be available but undefined. How to achieve that?