title: (.net core 3.1 & Angular) Json Patch: The path segment is invalid for an array index
body: <p>I have a json file with the following content:</p>
  <pre><code>{
      &quot;Id&quot;: 0,
      &quot;Name&quot;: &quot;todoList1&quot;,
      &quot;ListItems&quot;: [
          {
              &quot;Id&quot;: 1,
              &quot;Description&quot;: &quot;listItem1.1&quot;,
              &quot;Done&quot;: false
          },
          {
              &quot;Id&quot;: 2,
              &quot;Description&quot;: &quot;listItem1.2&quot;,
              &quot;Done&quot;: true
          }
      ]
  }
  </code></pre>
  <p>Additionally I have an ASP.NET Core 3.1 API method which should be able to partially update the json:</p>
  <pre><code> [HttpPatch(&quot;{name}&quot;)]
      public async Task&lt;TodoListDomainModel&gt; Update([FromRoute] string name, [FromBody]JsonPatchDocument&lt;TodoListDomainModel&gt; todoListJsonPatchDocument)
      {
          var todoListToPatch = (await this._todoListService.GetTodoLists()).Single(x =&gt; x.Name == name);
          todoListJsonPatchDocument.ApplyTo(todoListToPatch);
          return todoListToPatch;
      }
  </code></pre>
  <p>The <code>TodoListDomainModel</code>:</p>
  <pre><code>public class TodoListDomainModel
  {
      public int Id { get; set; }
      public string Name { get; set; }
  
      public ICollection&lt;ListItemDomainModel&gt; ListItems { get; set; } = new Collection&lt;ListItemDomainModel&gt;();
  }
  </code></pre>
  <p>The <code>ListItemDomainModel</code>:</p>
  <pre><code>public class ListItemDomainModel
  {
      public ListItemDomainModel()
      {
      }
  
      public int Id { get; set;  }
  
      public string Description { get; set; }
  
      public bool Done { get; set; }
  
      public DateTime DueDate { get; set; }
  }
  </code></pre>
  <h1>Calling the API method via Angular</h1>
  <p>When calling the API method via angular:</p>
  <pre><code>save(selectedTodoList: TodoList) {
      let test = JSON.stringify(selectedTodoList.listItems);
      let json = `[{&quot;op&quot;: &quot;replace&quot;, &quot;path&quot;: &quot;/ListItems&quot;, &quot;value&quot;: ${test} }]`;
      let url = `https://localhost:44305/todolist/${selectedTodoList.name}`;
      return this.http.patch&lt;TodoList&gt;(url, json);
    }
  </code></pre>
  <p>I'm not even coming to the breakpoint in the api method.</p>
  <p>Is there something I'm doing wrong?</p>
  <p>Thanks in advance</p>