json-schema-diff 0.1.8

Diff changes between JSON schema files.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use insta::{assert_debug_snapshot, glob, with_settings};
use json_schema_diff::diff;
use serde_json::Value;

#[test]
fn test_from_fixtures() {
    let test = |path: &std::path::Path| {
        let contents = std::fs::read_to_string(path).unwrap();
        let values: Value = serde_json::from_str(&contents).unwrap();
        let diff = diff(values["lhs"].clone(), values["rhs"].clone()).unwrap();
        with_settings!({ info => &values }, {
            assert_debug_snapshot!(diff);
        });
    };
    glob!("../tests/fixtures", "**/*.json", test);
}