Closed vileanco closed 1 week ago
Ah, that's annoying. Seems like library I use, treediff
, does not distinguish enough between arrays and objects.
I'll try to rewrite the whole diffing myself. Doing it directly against serde_json::Value
should be easier than try to coerce this library for my needs... And then I would only "diff" same-kinded nodes, any time node kind changes ("object" vs "string" or "object" vs "array"), I would simply issue patch "replace" operation.
Should be fixed in 1.3.0.
Should be fixed in 1.3.0.
that was fast, I'll try it out! thanks 😄
There seems to be an issue with the json_patch::diff function. The path op Add is returned before Remove. Added failing test case as an example:
gives output
If I try this same with some other diff tool eg (https://json-patch-builder-online.github.io/) it gives the patches in right order eg.:
while this lib gives the Add op first.