Rollup merge of #138763 - aDotInTheVoid:two-years-later, r=GuillaumeGomez

jsondocck: Replace `jsonpath_lib` with `jsonpath-rust`

The current jsonpath implementation we use isn't spec-compliant, and is buggy. See https://github.com/freestrings/jsonpath/issues/91

To solve it, it's replaced with https://github.com/besok/jsonpath-rust. This is spec-compiant, and doesn't have a really awkward bug we need to always dance around.

Unfortunately, this requires rewriting almost every test, as the behaviour of `[?(```@`,``` which is *extremely* common was changed. (But the new behaviour makes way more sense, and isn't buggy with tripply nested selectors)

Unblocks #110406. Makes #100515 much easier as we don't need to explain the broken JSONPath implementation

Best reviewed commit-by-commit. The first does the replacement. The next two rewrite the test-suite mechanically. The last rewrites the test-suite by hand.

r? ```@GuillaumeGomez```
This commit is contained in:
Matthias Krüger 2025-03-22 11:59:19 +01:00 committed by GitHub
commit a4c0173d12
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
155 changed files with 1259 additions and 1192 deletions

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]]
@ -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.28.0"