Closed catalinstochita closed 1 year ago
Great to hear the library is useful. Thank you for the PR.
closes #55
Looks like this needs more work.
let json: Box<Value> = Box::new(json!({"first":{"second":{"active":1}}}));
let path: Box<JsonPathInst> = Box::from(
JsonPathInst::from_str("$.first[?(!(@.second.active == 1) || @.second.active == 1)]")
.expect("the path is correct"),
);
let finder = JsonPathFinder::new(json, path);
let v = finder.find_slice();
assert_eq!(v, vec![Slice(&json!({"second":{"active": 1}}), "$.['first']".to_string())]);
assertion `left == right` failed
left: [NoValue]
right: [Slice(Object {"second": Object {"active": Number(1)}}, "$.['first']")]
The negate evaluates only the first expression, we need to be able to chain them
Thanks for the changes but There is a fail in rust fmt. Just kick off the following command:
cargo fmt --all -- --check
locally and reformat the files or the whole project using rustfmt
if it is possible.
Hi. I'm using this library at work along with a java library too. We have some filters that are using the '!' to negate the expression and is not supported in rust. I have made the changes and it seems to works. I would appreciate it if you could review my implementation. Thanks