-
Notifications
You must be signed in to change notification settings - Fork 15
Exclude properties from diff #29
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Ignoring properties is currently not supported, but I do have plan to add this feature (hopefully next version), and it shouldn't be hard to do. In a nutshell, I was planning to add a property filter like jsondiffpatch has here in
A custom filter can get the property name and the diff context and return a boolean value to indicate whether to ignore the property. I'm re-considering / restructuring the diff engine at the moment given my next priority is adding some support to |
@weichch This would be great to have |
Any progress on |
I actually prioritized this a little bit because it will be taking a bit longer to add I've done the changes locally, which I pushed it up just now #30, and released a preview version. I still need to add some tests in order to release a stable version. Do both of you and @tomasbruckner mind providing some test cases you'd like the property filter to cover? |
@weichch that's great to hear! |
Seems like there is a quirk in array diff where the property filter is not applied to array items, because the the comparison is done using I tested |
For me it can works in the same way like in |
Hi, is there a way to ignore properties from diff? The JsonDiffPatch does it here https://github.com/wbish/jsondiffpatch.net/blob/master/Src/JsonDiffPatchDotNet/JsonDiffPatch.cs#L332
What I am missing in the JsonDiffPatch is that it only allows you to exclude paths instead of properties which is a problem with recursive objects or arrays. To ignore property
foo
in an array of objectsyou would have to do
This is useful in some scenarios, but it would be amazing if there would also be an option to exclude properties by their name
The JsonDiffPatch looks abandoned so I am looking for an alternative that would support this scenario.
Is it something doable?
The text was updated successfully, but these errors were encountered: