jsonpath-plus

A JSONPath implementation in Rust, compliant with the Proposal A specification as well as including several extensions such as parent and subpath selectors

10 releases

0.1.9 Feb 17, 2022
0.1.8 Feb 12, 2022

#1863 in Parser implementations

Download history 380/week @ 2024-07-21 441/week @ 2024-07-28 457/week @ 2024-08-04 367/week @ 2024-08-11 475/week @ 2024-08-18 327/week @ 2024-08-25 371/week @ 2024-09-01 451/week @ 2024-09-08 585/week @ 2024-09-15 462/week @ 2024-09-22 335/week @ 2024-09-29 319/week @ 2024-10-06 329/week @ 2024-10-13 379/week @ 2024-10-20 409/week @ 2024-10-27 293/week @ 2024-11-03

1,439 downloads per month
Used in 8 crates (3 directly)

MIT/Apache

96KB
2.5K SLoC

Rust JSONPath Plus

crates.io Documentation MIT/Apache-2 licensed

An implementation of the JSONPath A spec in Rust, with several extensions added on.

This library also supports retrieving AST analysis of compiled paths, so users may implement syntax highlighting or nice error reporting on top of it.

Extensions

  • Parent selector ^, used as $.a.b.^ or $['a']['b'][^]. Matches the parent of the currently selected object.
  • Subpath selectors, used as $['a'][$.b.id] or $['a'][@.sum.id]. Evaluates the subpath, then selects items with keys same as the result of the subpath.
  • ID selector ~, used at the end of the path as @.a.b~ or $['a']['b']~. Can be used in filters to compare against the ID of a matched item. Doesn't yet work at the top level.

Dependencies

~1–1.5MB
~31K SLoC