score:0

The syntax here is not quite right. 'pick' returns a JsValue (the Play! equivalent of valid Json types including String, Array, etc).

To validate multiple json fields you need to use 'pickBranch' which returns a JsObject (which is basically the equivalent of a Map[String, JsValue]). I'm guessing that reduce is a merge operation for several JsObjects.

I actually still haven't found a good use case for 'pick'. The '\' syntax seems to do the equivalent job with less code and clutter.


Related Query

More Query from same tag