idubrov / json-patch

RFC 6902 (JSON Patch) / RFC 7396 (JSON Merge Patch) implementation for Rust
Apache License 2.0
127 stars 17 forks source link

Diff 2 JSONs and create Patch #4

Closed mbalex99 closed 5 years ago

mbalex99 commented 6 years ago

How would you diff a left and right hand side json and create patches?

idubrov commented 6 years ago

You can build something together using this crate: http://crates.io/crates/treediff.

It would be a good optional feature of this crate: provide differ that generates JSON Patch (using treediff behind the scenes)!

idubrov commented 6 years ago

All, right, I put together a simple implementation using treediff. Let me know if that works for you (there should be a diff function in the crate returning the patch generated by comparing two trees)!

idubrov commented 5 years ago

Released to crates.io