serde_json_path
RFC 9535 JSONPath queries for serde_json Value trees in Rust.
Repository Health
Technical Analysis
serde_json_path lets Rust programs query serde_json::Value data using JSONPath, the RFC 9535 standard query language for JSON. It parses JSONPath expressions and evaluates them against JSON trees, returning matched nodes for extraction, filtering, or existence checks.
What You Get
- A
JsonPathtype parsed once from a JSONPath string and reused across queries - Full RFC 9535 filter-expression support (comparisons, logical operators, function extensions)
- Optional
regexfeature enabling regex-based filter functions - Validation against the official JSONPath Compliance Test Suite as a git submodule
Common Use Cases
- Extracting specific fields from deeply nested or variably-shaped JSON API responses
- Filtering arrays of JSON objects by field values without writing manual recursive matching code
- Validating that a JSON document contains expected paths in tests or data pipelines
- Implementing configuration or template systems that reference JSON data by JSONPath expression
Under The Hood
Architecture - The workspace splits parsing/AST types into serde_json_path_core, procedural macros (for compile-time-checked embedded JSONPath literals) into serde_json_path_macros, and the main serde_json_path crate wires a nom-based recursive-descent parser to an evaluator that walks serde_json::Value trees node-by-node, applying selectors (name, index, slice, wildcard, filter) at each step. Tech Stack - Rust 2021 edition, built on nom for parsing, serde/serde_json for the JSON value model, thiserror for error types, inventory for the function-extension registry, with optional regex and tracing features gated behind Cargo feature flags. Code Quality - Tested extensively: tests/compliance.rs runs the official RFC 9535 JSONPath Compliance Test Suite (vendored as a git submodule and run via a dedicated CI workflow), alongside serde.rs, functions.rs, spec_examples.rs, and regressions.rs for serde integration, function extensions, spec examples, and regression coverage respectively. API Design - The API centers on a single JsonPath::parse entry point returning a reusable query object with .query()/.query_located() methods, plus a json_path! macro for compile-time-validated literals — a small, consistent surface that maps closely to how JSONPath itself is used.
Used by 3 apps in this directory
Arroyo
Data Engineering · Analytics
A distributed stream processing engine written in Rust that lets you write SQL to run stateful, real-time computations over data streams with subsecond results.
Fern
Developer Tools
Fern turns a single OpenAPI, AsyncAPI, or Protobuf definition into type-safe SDKs for nine languages and a hosted API documentation site, all from one CLI and one source of truth.
Latitude
AI Agents · Monitoring
Open-source AI agent monitoring that catches what will break next before your users do.