Skip to content

Please adjust the array "remove" operations’ order in the patch result #30

@substancettt

Description

@substancettt

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"}}]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions