Skip to content

Use an array to specify a property path #24

Open
@awwright

Description

@awwright

JSON Patch specifies that paths be specified in a string format as specified by RFC 6901. This requires additional steps to form paths, first to escape characters (in a new, invented escape not used elsewhere), then joining the segments together prepended by a "/". This seems unnecessary.

JSON Patch should accept an array path format, where each item in the array descends into an object property (if a string) or an array item (if an integer). To adapt examples from RFC 6902:

   { "op": "add", "path": ["a", "b", "c"], "value": "foo" },
   { "op": "copy", "from": ["a", "b", "c"] "path": ["a", "b", "e"]},
   { "op": "remove", "path": ["foo", 1]},
   { "op": "test", "path": ["~1"], "value": 10},

etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions