jmespath 0.0.1

Rust implementation of JMESPath, a query language for JSON
Documentation

JMESPath.rs

Rust implementation of JMESPath, a query language for JSON.

Build Status Coverage Status

Documentation

This crate is on crates.io and can be used by adding jmespath to the dependencies in your project's Cargo.toml.

[dependencies]
jmespath = "0.0.1"
extern crate jmespath;

let expr = jmespath::Expression::new("foo.bar | baz").unwrap();

// Parse some JSON data into a JMESPath variable
let json_str = "{\"foo\":{\"bar\":{\"baz\":true}}}";
let data = jmespath::Variable::from_json(json_str).unwrap();

// Search the data with the compiled expression
let result = expr.search(data).unwrap();
assert_eq!(true, result.as_boolean().unwrap());