Skip to content

Tidy up: runtime JSON-Pointer escape for map keys in generated validators (EsmRenderer.java) #204

Open

Description

@simbo1905

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

  1. PR Port jtd-esm-codegen onto the incubator main #169 — Runtime map keys are not JSON-Pointer escaped in generated error paths.
    Author: chatgpt-codex-connector[bot], 2026-08-31. Comment: Port jtd-esm-codegen onto the incubator main #169 (comment)
    Source: jtd-esm-codegen/src/main/java/io/github/simbo1905/json/jtd/codegen/EsmRenderer.java:275. Current: jtd-esm-codegen/src/main/java/io/github/simbo1905/json/jtd/codegen/EsmRenderer.java:255-256 and 276 (pathExpr + " + \"/\" + k" for values loop and additional-properties keys — runtime key appended verbatim; jsonPointerEscape() exists but is only applied to compile-time keys).
    Flagged: "When a values object has a key containing / or ~ and its value fails validation, the generated error path appends the key verbatim, so key a/b is reported as /a/b rather than /a~1b... emit a runtime JSON Pointer token escape here and in the analogous additional-properties path".
    Still applies: runtime keys still interpolated without a runtime ~0/~1 escape in the values and additionalProperties error paths.
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