jsondocck: Replace jsonpath_lib with jsonpath-rust

This commit is contained in:
Alona Enraght-Moony
2025-03-20 22:38:46 +00:00
parent d8e44b722a
commit a0918b7f5f
4 changed files with 77 additions and 10 deletions
+60 -8
View File
@@ -1925,7 +1925,7 @@ version = "0.1.0"
dependencies = [
"fs-err",
"getopts",
"jsonpath_lib",
"jsonpath-rust",
"regex",
"serde_json",
"shlex",
@@ -1945,14 +1945,16 @@ dependencies = [
]
[[package]]
name = "jsonpath_lib"
version = "0.3.0"
name = "jsonpath-rust"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eaa63191d68230cccb81c5aa23abd53ed64d83337cacbb25a7b8c7979523774f"
checksum = "9b0231bb404a6cd6c8f0ab41b907049063a089fc02aa7636cc5cd9a4d87364c9"
dependencies = [
"log",
"serde",
"pest",
"pest_derive",
"regex",
"serde_json",
"thiserror 2.0.11",
]
[[package]]
@@ -2021,7 +2023,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34"
dependencies = [
"cfg-if",
"windows-targets 0.48.5",
"windows-targets 0.52.6",
]
[[package]]
@@ -2645,6 +2647,51 @@ dependencies = [
"libc",
]
[[package]]
name = "pest"
version = "2.7.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b7cafe60d6cf8e62e1b9b2ea516a089c008945bb5a275416789e7db0bc199dc"
dependencies = [
"memchr",
"thiserror 2.0.11",
"ucd-trie",
]
[[package]]
name = "pest_derive"
version = "2.7.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "816518421cfc6887a0d62bf441b6ffb4536fcc926395a69e1a85852d4363f57e"
dependencies = [
"pest",
"pest_generator",
]
[[package]]
name = "pest_generator"
version = "2.7.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7d1396fd3a870fc7838768d171b4616d5c91f6cc25e377b673d714567d99377b"
dependencies = [
"pest",
"pest_meta",
"proc-macro2",
"quote",
"syn 2.0.96",
]
[[package]]
name = "pest_meta"
version = "2.7.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e1e58089ea25d717bfd31fb534e4f3afcc2cc569c70de3e239778991ea3b7dea"
dependencies = [
"once_cell",
"pest",
"sha2",
]
[[package]]
name = "phf"
version = "0.11.3"
@@ -4780,7 +4827,6 @@ version = "1.0.135"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b0d7ba2887406110130a978386c4e1befb98c674b4fba677954e4db976630d9"
dependencies = [
"indexmap",
"itoa",
"memchr",
"ryu",
@@ -5486,6 +5532,12 @@ dependencies = [
"regex-lite",
]
[[package]]
name = "ucd-trie"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971"
[[package]]
name = "ui_test"
version = "0.26.5"
@@ -6,18 +6,25 @@
"annotate-snippets",
"anstyle",
"basic-toml",
"block-buffer",
"bumpalo",
"cfg-if",
"cpufeatures",
"crypto-common",
"darling",
"darling_core",
"derive_builder_core",
"digest",
"fluent-bundle",
"fluent-langneg",
"fluent-syntax",
"fnv",
"generic-array",
"heck",
"ident_case",
"intl-memoizer",
"intl_pluralrules",
"libc",
"log",
"memchr",
"mime",
@@ -25,12 +32,17 @@
"minimal-lexical",
"nom",
"num-conv",
"once_cell",
"pest",
"pest_generator",
"pest_meta",
"proc-macro2",
"quote",
"rinja_parser",
"rustc-hash",
"self_cell",
"serde",
"sha2",
"smallvec",
"stable_deref_trait",
"strsim",
@@ -40,12 +52,15 @@
"time-core",
"tinystr",
"type-map",
"typenum",
"ucd-trie",
"unic-langid",
"unic-langid-impl",
"unic-langid-macros",
"unicase",
"unicode-ident",
"unicode-width",
"version_check",
"wasm-bindgen-backend",
"wasm-bindgen-macro-support",
"wasm-bindgen-shared",
+1 -1
View File
@@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2021"
[dependencies]
jsonpath_lib = "0.3"
jsonpath-rust = "1.0.0"
getopts = "0.2"
regex = "1.4"
shlex = "1.0"
+1 -1
View File
@@ -30,6 +30,6 @@ pub fn new(config: &Config) -> Cache {
// FIXME: Make this failible, so jsonpath syntax error has line number.
pub fn select(&self, path: &str) -> Vec<&Value> {
jsonpath_lib::select(&self.value, path).unwrap()
jsonpath_rust::query::js_path_vals(path, &self.value).unwrap()
}
}