This commit is contained in:
JMARyA 2023-11-06 09:36:42 +01:00
parent e76f1e4419
commit 526b699845
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
2 changed files with 40 additions and 0 deletions

View file

@ -149,6 +149,24 @@ fn main() {
let mut diff = serde_json::to_value(diff).unwrap();
if let Some(test_cases) = args.get_many::<String>("test") {
// TODO : Multiple test arguments
let test_cases: Vec<_> = test_cases.collect();
let path = test_cases.get(0).unwrap();
let val = test_cases.get(1).unwrap();
diff.as_array_mut().unwrap().insert(0,
serde_json::json!(
{
"op": "test",
"path": path,
"value": val
}
)
);
}
if let Some(excludes) = args.get_many::<String>("exclude") {
let excludes: Vec<String> = excludes.cloned().collect();
diff = exclude_json_paths(&diff, &excludes);