Closed germanovs closed 3 years ago
I think this is an expected, although maybe confusing, behavior. As per RFC:
If removing an element from an array, any elements above the specified index are shifted one position to the left.
So in such case, if you have [0,1,2]
and you remove index 1
twice you end up having [0]
:
[0,1,2]
--> [0,2]
after application of first removal,[0,2]
--> [0]
after application of second removal on the value created by first removal.
You can try applying resulting patch to the original data and check if it produces New JSON.
Hello! Here is the situation: I have 3 items in origin array and remove last 2 of them. In exported patch there are 2 removes, but with similar indexes. This issue does not appear on added items.
Example. Origin JSON.
New JSON.
Code
Output
Companies with indexes 1 and 2 are removed, but it paths both indexes are 1. At the same time paths of added items in Contacts are ok (1 and 2). Or I miss something?
Thanks in advance!