title: jsonpatch path to update array object
body: <p>I am having trouble updating an array using json patch and dotnetcore Microsoft.AspNetCore.JsonPatch.</p>
  <p>The idea is to create an operation that replaces the content of an existing array, which in the backend is a list of objects. I have read on <a href="http://jsonpatch.com/" rel="nofollow noreferrer">http://jsonpatch.com/</a> that you can only use pointers to replace array content. This is not optimal since an array might not be properly sorted. So I tried replacing the content of the entire array, but when applying the replace I get an error:</p>
  <p>Microsoft.AspNetCore.JsonPatch.Exceptions.JsonPatchException: The value '' is invalid for target location.</p>
  <p>This would be an example body of the json patch:</p>
  <pre><code>[{
      &quot;op&quot;: &quot;replace&quot;,
      &quot;path&quot;: &quot;/users&quot;,
      &quot;value&quot;:[
              {
                      &quot;name&quot; : &quot;john doe&quot;,
                      &quot;age&quot; : 35
              },
              {
                      &quot;name&quot; : &quot;mary jane&quot;,
                      &quot;age&quot; : 26
              }
      ]
    }
  ]
  </code></pre>
  <p>Any idea on how to create a body to replace arrays using json patch?</p>
  <p>Best regards</p>