Access values in your JSON data using string paths (e.g. "result.item[0].value").
cargo add json_walk
use json_walk::{
file_handler::FileHandler,
json_walk
};
use serde_json::Value;
let data = FileHandler::load("storage/test-data/data.json").unwrap();
let walker = json_walk(data);
let result = walker.get("result.item[0].value");
// result.unwrap() -> "apple"| Pattern | Meaning |
|---|---|
a.b.c |
object key access |
a[0] |
array index access |
status |
top-level key |
a[0].value |
array index the key access |
- Support
obj["key"] - Support
a.value\.1
See LICENSE for details.