Skip to content

add PatchBehavior.PatchBehavior#66

Open
Newp wants to merge 3 commits intowbish:masterfrom
Newp:master
Open

add PatchBehavior.PatchBehavior#66
Newp wants to merge 3 commits intowbish:masterfrom
Newp:master

Conversation

@Newp
Copy link
Copy Markdown

@Newp Newp commented May 27, 2023

Left: {"value":1}
Right: {"value":3}

If you create a Diff in the above cases, it is generated as shown below.
Diff : {"value": [1,3]}

If normal, it will be treated as value=3.

However, if an unintended modulation occurs on the left and right for various reasons, such as concurrency control failure, and you try to diff/patch it, if you turn {"value":[2,3]} over to the parameter, it will eventually set to value=3.

As a result, the value of 3 is the same, but the user may not have intended it.

Therefore, we added PatchBehavior to Options to validate that left.value should be equal to right[0] if LeftMatchValidation is set in the replace operation.

I'm using it well. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant