Crates.io | jmespatch |
lib.rs | jmespatch |
version | 0.3.0 |
source | src |
created_at | 2020-04-29 11:33:56.835298 |
updated_at | 2020-04-29 11:33:56.835298 |
description | Rust implementation of JMESPath, a query language for JSON |
homepage | https://github.com/ufoscout/jmespath.rs |
repository | https://github.com/ufoscout/jmespath.rs |
max_upload_size | |
id | 235299 |
size | 304,463 |
Rust implementation of JMESPath, a query language for JSON.
This repository was created with the only purpose of preparing a PR for the original jmespath.rs library.
However, after months of waiting for someone to comment on my PR, it is clear that the jmespath.rs project is in a dead state.
Consequently, I was forced to publish my fix to crates.io with the name jmespatch.
Compared to the original code, jmespatch:
I will keep it until any sign of life is provided by the original jmespath.rs project.
I will not add new features, but every PR submitted is warmly welcomed.
This crate is on crates.io and can be used
by adding jmespatch
to the dependencies in your project's Cargo.toml
.
[dependencies]
jmespatch = "0.3.0"
extern crate jmespatch;
let expr = jmespatch::compile("foo.bar").unwrap();
// Parse some JSON data into a JMESPath variable
let json_str = r#"{"foo": {"bar": true}}"#;
let data = jmespatch::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());