title: Updating a nested JsObject in Play Scala
body: <p>I have an input json that looks like this:</p>
  
  <pre><code>{
      "dashboard": {
              "id": 0,
              "originalTitle": "Test dashboard",
              "rows": [
                      {
                              "collapse": false,
                              "editable": true,
                              "height": "250px",
                              "panels": [],
                              "title": "Row"
                      }
              ],
              "schemaVersion": 0,
              "tags": [
                      "T35T-DA5H-80ARD"
              ],
              "timezone": "browser",
              "title": "Test dashboard",
              "version": 0
      },
      "overwrite": true
  }
  </code></pre>
  
  <p>I want to update the "panels" field by adding an element to the list. What I can do at the moment is pick the value of "panels":</p>
  
  <pre><code>val json = Json.parse(dashboardJson).validate[JsObject].get
  json.transform(
    (__ \ 'dashboard).json.pickBranch
    (
      (__ \ 'rows).json.pickBranch
      (
        (__ \\ 'panels).json.pick
      )
    )
  )
  </code></pre>
  
  <p>This results in:</p>
  
  <pre><code>JsSuccess({"dashboard":{"rows":[]}},/dashboard/rows//panels)
  </code></pre>
  
  <p>But when I try to update it like this, it doesn't work:</p>
  
  <pre><code>json.transform(
    (__ \ 'dashboard).json.pickBranch
    (
      (__ \ 'rows).json.pickBranch
      (
        (__ \\ 'panels).json.update
        (
          __.read[JsObject].map { o =&gt; o ++ Json.obj( "bla" -&gt; "blabla" ) }
        )
      )
    )
  )
  </code></pre>
  
  <p>This results in:</p>
  
  <pre><code>JsError(List((/dashboard/rows,List(ValidationError(List(error.expected.jsobject),WrappedArray())))))
  </code></pre>
  
  <p>Any idea what I am doing wrong?</p>