Skip to content

Support patch mode #34

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

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

JeroenSoeters
Copy link

No description provided.

var aI interface{}
var bI interface{}
// An e rror will be returned if any of the two documents are invalid.
func CreatePatch(a, b []byte, collections Collections, strategy PatchStrategy) ([]JsonPatchOperation, error) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a way to retain the original API CreatePatch call with intelligent defaults so as to not break all current users?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I should have opened this in draft mode as this is really not ready yet.

To your point, yes, if there is a desire to merge this back in, we could make the strategy default to PatchStrategyExactMatch, which is what the current implementation does. The only thing I'd need to think through a bit is the collection handling, because for our use case, we default to set semantics, while the original implementation defaults to array semantics.

@JeroenSoeters JeroenSoeters marked this pull request as draft May 27, 2025 17:53
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.

2 participants