#json-path #json #json-query #query #extension #api-bindings

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

#2281 in Parser implementations

Download history 351/week @ 2023-12-13 167/week @ 2023-12-20 165/week @ 2023-12-27 221/week @ 2024-01-03 307/week @ 2024-01-10 332/week @ 2024-01-17 316/week @ 2024-01-24 417/week @ 2024-01-31 216/week @ 2024-02-07 241/week @ 2024-02-14 259/week @ 2024-02-21 256/week @ 2024-02-28 286/week @ 2024-03-06 353/week @ 2024-03-13 570/week @ 2024-03-20 355/week @ 2024-03-27

1,616 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

~0.8–1.3MB
~27K SLoC