-
Notifications
You must be signed in to change notification settings - Fork 50
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
base: master
Are you sure you want to change the base?
Conversation
…ented for EnsureExistsStrategy
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) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
No description provided.