Skip to content

Tidy up: reject or implement bracket targets after recursive descent (JsonPath.java) #185

Open

Description

@simbo1905

Sub-issue 6 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 6 (verbatim from the audit findings file) ==

  1. PR JsonPath AST and matching #124 — Recursive descent silently ignores bracket targets (unions/filters/slices/scripts).
    Authors: chatgpt-codex-connector[bot] 2026-02-01 (JsonPath AST and matching #124#discussion_r2751802264), gemini-code-assist[bot] 2026-02-01 (JsonPath AST and matching #124#discussion_r2751802336). Same site was also flagged for PR JsonPath AST implementation #123/JsonPath runtime compilation #133. Consolidated: two comments, one defect.
    Source: json-java21-jsonpath/src/main/java/json/java21/jsonpath/JsonPath.java:267-298. Current: json-java21-jsonpath/src/main/java/json/java21/jsonpath/JsonPath.java:299-300 (default -> "Unsupported target in recursive descent" log-only) with JsonPathParser.java:117-121 still wrapping ALL bracket notations into RecursiveDescent.
    Flagged: $..['author','title'], $..[?(@.price<10)], $..[0:2], $..[(...)] parse but yield no matches silently. Suggested: either reject those forms in the parser or support them in evaluateTargetSegment.
    Still applies: parser still accepts ..[ for any bracket form; evaluator still silently drops all but PropertyAccess/Wildcard/ArrayIndex.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions