jsonpath_rust

Macro path

Source
macro_rules! path {
    ( ) => { ... };
    (*) => { ... };
    ($) => { ... };
    (@) => { ... };
    (@$e:expr) => { ... };
    (@,$($ss:expr),+) => { ... };
    (..$e:literal) => { ... };
    (..*) => { ... };
    ($e:literal) => { ... };
    ($e:expr) => { ... };
}
Expand description

Can be used to Parse a JsonPath with a more native way. e.g.

use jsonpath_rust::{path, JsonPath};
use std::str::FromStr;
use serde_json::Value;

let path:JsonPath<Value> = JsonPath::from_str(".abc.*").unwrap();
let path2 = JsonPath::Chain(vec![path!("abc"), path!(*)]);
assert_eq!(path, path2);