besok / jsonpath-rust

Support for json-path in Rust
https://crates.io/crates/jsonpath-rust
MIT License
99 stars 26 forks source link

Handle length() correctly for nested structures #42

Open besok opened 1 year ago

besok commented 1 year ago

given json:

[
{"verb": "TEST","a":[1,2,3]},
{"verb": "TEST","a":[1,2,3]},
{"verb": "TEST"}, {"verb": "RUN"}
]

given jpath: $.[?(@.verb == 'TEST')].a.length()

Result: [2] Expected result: [3,3]