json-diff-ng
Contributors:
Library
json_diff_ng can be used to get diffs of json-serializable structures in rust.
Usage example
use compare_strs;
let data1 = r#"["a",{"c": ["d","f"] },"b"]"#;
let data2 = r#"["b",{"c": ["e","d"] },"a"]"#;
let diffs = compare_strs.unwrap;
assert!;
let diffs = diffs.unequal_values.get_diffs;
assert_eq!;
assert_eq!;
See docs.rs for more details.
CLI
json-diff is a command line utility to compare two jsons.
Input can be fed as inline strings or through files.
For readability, output is neatly differentiated into three categories: keys with different values, and keys not present
in either of the objects.
Only missing or unequal keys are printed in output to reduce the verbosity.
Usage Example:
$ json_diff file source1.json source2.json
$ json_diff direct '{...}' '{...}'
Option:
file : read input from json files
direct : read input from command line
Installation
$ cargo install json_diff_ng