You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A common theme that has been developing is people that want to customize the output of the patch object:
#20 wants to create a compact json patch object where each left value is omitted -- does not care about unpatch functionality. #21 wants to skip adding to the patch document cases where the same key exists but the value is different. This means edits are not included in the patch document -- only adds and deletes. Essentially wants to see if the structure of the document has changed -- not so much the contents of each key. #18 seeks to find diff of a subset of the document.
I do not want to change the default behavior of JsonDiffPatch because I think the main value add of the library is to support straightforward diff/patch/unpatch.
However, I think there is a valid case to make for JsonDiffPatch support custom diff comparers that can have user defined behavior.
JsonDiffPatch(Option, IComparer)
I have not thought this through, but the interface might look something like the following:
IComparer
handleEdit(path, key, left, right)
handleAdd(path, key, right)
handleDelete(path, key, left)
This is not really diff patch output formatter as the output would still technically be supported by patch and unpatch -- however, those methods may just have weird behavior if someone implements a strange IComparer.
The text was updated successfully, but these errors were encountered:
We have a legacy database, and now we built a central tool to manage our configuration data. Problem is that old tools still use the legacy db, so we still need to push data from the new tool to the legacy db for backward compatibility.
What can happen is that someone can go and change some value directly via DB (bad) or our tool is unable to sync the data. Either case, we have mismatched data.
We created a reconciliation process that fetch data from both side and compare it. Later on, we want to produce a report that contains the diff and what didn't match. JsonDiffPatch would be perfect for producing a diff of the data (we already have it in Json format). But, having the whole document doesn't help. When there's an issue, we want to look at the report and easily spot what's not matching.
For small documents it's fine, but that's really not the case on real world apps. Our documents have more than 15 fields plus nested arrays.
A common theme that has been developing is people that want to customize the output of the patch object:
#20 wants to create a compact json patch object where each left value is omitted -- does not care about unpatch functionality.
#21 wants to skip adding to the patch document cases where the same key exists but the value is different. This means edits are not included in the patch document -- only adds and deletes. Essentially wants to see if the structure of the document has changed -- not so much the contents of each key.
#18 seeks to find diff of a subset of the document.
I do not want to change the default behavior of JsonDiffPatch because I think the main value add of the library is to support straightforward diff/patch/unpatch.
However, I think there is a valid case to make for JsonDiffPatch support custom diff comparers that can have user defined behavior.
JsonDiffPatch(Option, IComparer)
I have not thought this through, but the interface might look something like the following:
IComparer
This is not really diff patch output formatter as the output would still technically be supported by patch and unpatch -- however, those methods may just have weird behavior if someone implements a strange IComparer.
The text was updated successfully, but these errors were encountered: