playframework/playframework — pull request #3666 by gmethvin (2014-12-01 06:16:55+00:00)
Title: The path returned by JsPath.prune should be the original path

Contrary to JsPath.pick, the prune operation does not return a sub-tree of the JSON tree, but a tree where a sub-tree has been removed.

Currently, JsPath.prune returns the pruned path, which leads to paradoxes like the following:

```scala
scala> val jsonTransformer = (__ \ "a").json.prune andThen (__ \ "b").json.prune
jsonTransformer: play.api.libs.json.Reads[play.api.libs.json.JsObject] = play.api.libs.json.Reads$$anon$8@47517c4a

scala> Json.parse("{\"a\": 12, \"b\": 23, \"c\": 34}").transform(jsonTransformer)
res4: play.api.libs.json.JsResult[play.api.libs.json.JsObject] = JsSuccess({"c":34},/a/b)
```

where the returned path `/a/b` does not even exist in the original document.