Skip to content

Tidy up: implement JSON escape sequences in JsonPath string literals (JsonPathParser.java) #184

Open

Description

@simbo1905

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

  1. PR JsonPath AST implementation #123 — Quoted-string parsing does not implement JSON escape sequences.
    Author: gemini-code-assist[bot], 2026-02-01. Comment: JsonPath AST implementation #123 (comment)
    Source: json-java21-jsonpath/src/main/java/json/java21/jsonpath/JsonPathParser.java:179. Current: json-java21-jsonpath/src/main/java/json/java21/jsonpath/JsonPathParser.java:359-368 (parseLiteralString) and 490-510 (member-name scan); both only skip the character after a backslash and keep the raw escape text in the value.
    Flagged: "only escapes the character that follows a backslash, which is incorrect for standard JSON string escapes like \n, \t, or \uXXXX... can lead to incorrect parsing of property names that contain special characters".
    Still applies: escapes are never translated (no case for 'n'/'t'/'u'), so a filter literal 'a\tb' or a quoted member name with an escaped character matches a different string than the JSON-equivalent one.
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