You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tidy up: stop literal-only filters from matching all elements (JsonPath.java) #183
Sub-issue 4 of 26 from the 2026-11-21 bot-review-comment audit. Parent issue: #179 (Bot review comment tidy up).
Audited origin/main HEAD: 2e5cf37. Audit date: 2026-11-21.
== Finding 4 (verbatim from the audit findings file) ==
PR JsonPath AST and matching #124 — matchesFilter returns true for ANY LiteralValue (e.g. [?(false)] matches everything).
Author: gemini-code-assist[bot], 2026-02-01. Comment: JsonPath AST and matching #124 (comment)
Source: json-java21-jsonpath/src/main/java/json/java21/jsonpath/JsonPath.java:307. Current: json-java21-jsonpath/src/main/java/json/java21/jsonpath/JsonPath.java:342 (case JsonPathAst.LiteralValue ignored -> true;).
Flagged: "a filter expression like [?(false)] or [?(0)] would incorrectly match all elements". Suggested: yield the boolean only for Boolean literals, false otherwise.
Still applies: current parser (JsonPathParser.parseFilterAtom, lines 289-320) now CAN produce a standalone literal as the whole filter, so the case is reachable and still returns true for false/0/'' — e.g. [?(false)] matches every element.
Activity