Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is it possible to invert a patch #3

Closed
weepy opened this issue Apr 28, 2013 · 1 comment
Closed

is it possible to invert a patch #3

weepy opened this issue Apr 28, 2013 · 1 comment
Labels

Comments

@weepy
Copy link

weepy commented Apr 28, 2013

I.e.

new_obj = apply(obj, patch)

remove(new_obj, path) // == obj

@Starcounter-Jack
Copy link
Owner

I understood your question as wether applied patches could be reverted.
I.e.

apply(obj,patch); // Make changes
revert(obj,patch); // Undo changes

Unfortunately the original values are lost when applying the patch and as the patch format itself is controlled by the RFC, I guess this would not be possible within the capabilities of the JSON Patch standard.

Let me know if I misunderstood the question and I'll reopen this issue.

Starcounter-Jack pushed a commit that referenced this issue Aug 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants