Skip to content

Allow optional "priorValue" #35

Description

@mike-sierra

If using JSON Patch data to compare JSONs A and B as a series of patches, rather than transform A to B, there's additional value in comprehending what value is being replaced or deleted. A "priorValue" would help the client user fully understand each change. For example, this clarifies the change was incrementing the value by 1.

       {
          "op": "replace",
          "path": "/a/b/c",
          "priorValue": 41,
          "value": 42,
        }

It would be appropriate for "replace", "delete", "copy", and "move" operations,
any operation that can change an existing node.

The "priorValue" would be optional, for use in contexts such as comparisons where it's useful.
It's extraneous in ordinary JSON Patches that transform data.

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