this post was submitted on 25 Oct 2023
6 points (100.0% liked)

Rust

5754 readers
22 users here now

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

!performance@programming.dev

Credits

  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

founded 1 year ago
MODERATORS
 

Hey everyone, first time poster, long time lurker.

I've been crawling crates.io trying to find an existing crate that supports using JSONPath to query a document and returns both the selected node, and the actual path to said node.

For example, say I have the following JSON object:

{ 
  "foo": { 
    "bar": { 
      "baz": "hello!" 
    } 
  }
}

And I query it with $.foo.*.baz, it would return something like:

{ 
 node: "hello!", // Would be something like serde::Value
 path: "$.foo.bar.baz"
}

Does anything like this exist (or is in development) in the rust eco-system today?

Any help would be most appreciated, thank you!

you are viewing a single comment's thread
view the rest of the comments
[โ€“] davenull@programming.dev 1 points 10 months ago

UPDATE: This feature now exists in the jsonpath-rust crate ๐ŸŽ‰