jsonpatch
jsonpatch copied to clipboard
Please adjust the array "remove" operations’ order in the patch result
Different from other operations, the array "remove" operations’ order should be descending by path index.
Origin: [{"id": 1, "title":"news 1"}, {"id": 2, "title":"news 2"}, {"id": 4, "title":"news 4"}] Target: [{"id": 1, "title":"news 1"}, {"id": 3, "title":"news 3"}] Current patch: [{"op":"remove","path":"/1"},{"op":"remove","path":"/2"},{"op":"add","path":"/1","value":{"id":3,"title":"news 3"}}]
It's better to be: [{"op":"remove","path":"/2"},{"op":"remove","path":"/1"},{"op":"add","path":"/1","value":{"id":3,"title":"news 3"}}]