Skip to content

j-p-d-e-v/json-walk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSON Walk

Access values in your JSON data using string paths (e.g. "result.item[0].value").

Installing

cargo add json_walk

Example:

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"

Supported Path Syntax

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

TODO

  • Support obj["key"]
  • Support a.value\.1

License

See LICENSE for details.

About

Access values in your JSON data using string paths. (e.g. "result.item[0].value").

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages