Skip to content

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