fix: escape literal property names in data pointers - #129
Closed
fitchmultz wants to merge 1 commit into
Closed
fitchmultz wants to merge 1 commit into
fitchmultz wants to merge 1 commit into
Conversation
Author
Author
|
Superseded by #130, which includes this commit. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Data pointers concatenate property names without escaping
/or~. Distinct locations can therefore produce the same error pointer:Both errors currently report
#/a/b/c; they should report#/a~1b/cand#/a/b~1c.Changes
Use the existing
@sagold/json-pointerarray-formjointo append escaped literal segments, preserving the existing prefix verbatim. Apply it to property validation, nested property-name and oneOf-declarator errors,getNodetraversal diagnostics, andtoDataNodes. Empty names and numeric indexes remain intact. Schema-location strings and validation rules are unchanged.Verification
Using pnpm 10 with the frozen lockfile:
pnpm run test:unit: 1,037 passing, 3 pending.pnpm run test:spec: 7,513 passing, 9 pending.pnpm run dist: passes; the built ESM entry point also passes the repro and a valid-data control. Generated bundles are left to the release process.lint:src,lint:types, andlint:testsstill fail with the same 3, 4, and 107 diagnostics, respectively, reproduced on a clean65578c1baseline. No new diagnostics.Upstream CI is awaiting maintainer approval for this fork contribution; no CI jobs have run yet.
If accepted, would you consider including this in a stable patch release? Thank you.