From 8a11e10be4bfed3fae44c5b4204df912730ad117 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 16 Jan 2026 18:52:57 +0000 Subject: [PATCH 1/2] Bump jsonpath-rust from 0.7.5 to 1.0.4 Bumps [jsonpath-rust](https://github.com/besok/jsonpath-rust) from 0.7.5 to 1.0.4. - [Changelog](https://github.com/besok/jsonpath-rust/blob/main/CHANGELOG.md) - [Commits](https://github.com/besok/jsonpath-rust/commits) --- updated-dependencies: - dependency-name: jsonpath-rust dependency-version: 1.0.4 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fa18fd1..56a1a6d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -795,9 +795,9 @@ dependencies = [ [[package]] name = "jsonpath-rust" -version = "0.7.5" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c00ae348f9f8fd2d09f82a98ca381c60df9e0820d8d79fce43e649b4dc3128b" +checksum = "633a7320c4bb672863a3782e89b9094ad70285e097ff6832cddd0ec615beadfa" dependencies = [ "pest", "pest_derive", diff --git a/Cargo.toml b/Cargo.toml index 8051541..7e05f3c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ serde_json = "1.0" uuid = { version = "1.8.0", features = ["v7", "serde"] } chrono = { version = "0.4.43", features = ["serde"] } jsonb = "0.5.5" -jsonpath-rust = "0.7" +jsonpath-rust = "1.0" tokio = { version = "1.49.0", features = ["full"] } async-trait = "0.1.89" futures = "0.3.31" From 207bf8e71772602f6f542788f27dfdf66800dd48 Mon Sep 17 00:00:00 2001 From: Michael Mior Date: Fri, 16 Jan 2026 14:09:43 -0500 Subject: [PATCH 2/2] fix(query): adapt to jsonpath-rust 1.0.4 trait changes --- src/query.rs | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/src/query.rs b/src/query.rs index 7815996..a889a05 100644 --- a/src/query.rs +++ b/src/query.rs @@ -1,8 +1,7 @@ use crate::db::DB; -use jsonpath_rust::JsonPath; +use jsonpath_rust::query::js_path_vals; use serde_json::Value; use std::cmp::Ordering; -use std::str::FromStr; use tracing::{Level, span}; @@ -218,18 +217,13 @@ fn evaluate_expression(expr: &Expression, doc: &Value) -> Value { match expr { Expression::FieldReference(path) => get_path(doc, path).unwrap_or(Value::Null), Expression::JsonPath(path) => { - if let Ok(p) = JsonPath::from_str(path) { - let inst = p.find(doc); - if let Some(arr) = inst.as_array() { - if arr.is_empty() { - Value::Null - } else if arr.len() == 1 { - arr[0].clone() - } else { - inst.clone() - } + if let Ok(nodes) = js_path_vals(path, doc) { + if nodes.is_empty() { + Value::Null + } else if nodes.len() == 1 { + nodes[0].clone() } else { - inst + Value::Array(nodes.into_iter().cloned().collect()) } } else { Value::Null