gjson.rs icon indicating copy to clipboard operation
gjson.rs copied to clipboard

Literal support?

Open celaus opened this issue 2 years ago • 3 comments

Hi,

contrary to the Go implementation, this version doesn't seem to implement the literal notation.

const JSON: &str = r#"{"name":{"first":"Janet","last":"Prichard"},"age":47}"#;

fn main() {
    let value = gjson::get(JSON, r#"{name.first,abc:!"abc"}"#);
    println!("{}", value); // Expected {"first":"Janet", "abc": "abc"}
}

Whereas it's

    Finished dev [unoptimized + debuginfo] target(s) in 0.00s
     Running `target/debug/h`
    {"first":"Janet"}

Are there any plans? Or am I doing something wrong?

celaus avatar Apr 14 '22 12:04 celaus