json-difference
json-difference copied to clipboard
Optional output in JSON Patch format?
Would you consider optionally providing the diff in a format compatible with JSON Patch (RFC 6902) ?
Hey @bmaranville,
It's a very interesting format, I almost followed something similar at first, but the difficulty of interpreting "move" made me not follow. And the understanding of having a result that could be minimalistic for database storage also helped to shape the json-diffrence lib.
What is a "moved" value? The union of two operations in the context of diff between two structures?
1- Op. remove 2- Op. add
And what if there are repeated values?
I didn't know this RFC, I really liked the proposal, I need to read it calmly.
But what would be your idea, 100% support for this RFC or basically followed the same output idea offered by "json-difference" but following RFC 6962 format?
Thanks for looking into it! I was more interested in the latter: providing the same outputs, but in a format compatible with the spec. In my use case I would be diffing and patching, so having a standard intermediate patch object gives the most flexibility.
I think this PR will open some doors for us here. https://github.com/lukascivil/json-difference/pull/40 and https://github.com/lukascivil/json-difference/pull/43