We observed some weird behavior when using jsonpatch formatter. The diff was right but the output of jsonpatch formatter looks off.
When I looked into the jsonpatch formatter implementation, a method reorderOps caught my attention. I'm wondering why is it necessary to reorder the ops before they are returned, and why in this particular logic (remove first in desc order, then move and rest)?
We observed some weird behavior when using
jsonpatch
formatter. The diff was right but the output ofjsonpatch
formatter looks off.When I looked into the
jsonpatch
formatter implementation, a methodreorderOps
caught my attention. I'm wondering why is it necessary to reorder the ops before they are returned, and why in this particular logic (remove first in desc order, then move and rest)?