Conversation
vtushar06
force-pushed
the
json-pointer-coverage
branch
from
July 21, 2026 16:23
aa34958 to
f526859
Compare
Three more distinct cases the suite does not have. "/}" pins the %x7D top of the middle unescaped range (the suite has "|" = %x7C via /g|h but not "}"). Two normalization-resistance cases: a fullwidth tilde U+FF5E is an ordinary char, not the escape introducer ~, so /<U+FF5E> is valid; a ~ followed by a fullwidth digit U+FF10 is an invalid escape (~ must be followed by ASCII 0/1). RFC 6901 section 3 does no normalization.
Contributor
Author
|
hey @jviotti please have a look at this whenever you have timewidth. |
jviotti
approved these changes
Jul 27, 2026
jviotti
left a comment
Member
There was a problem hiding this comment.
Looks like good extra coverage to me
jdesrosiers
reviewed
Aug 4, 2026
No implementation in the matrix fails it - every validator that asserts json-pointer rejects it correctly, so it only guarded against a hypothetical implementation that truncates at a NUL.
jdesrosiers
requested changes
Aug 4, 2026
jdesrosiers
left a comment
Member
There was a problem hiding this comment.
The v1 tests are out of sync with the other branches.
The v1 fixture had drifted: it still carried the post-NUL dangling tilde case that was dropped from the other drafts, and it was missing the three cases added later (right curly bracket, fullwidth tilde, tilde then fullwidth digit). v1 keeps format tests under tests/v1/format rather than tests/*/optional/format, so it was missed by the earlier edits. All five fixtures now hold the same 46 tests and differ only in $schema.
Contributor
Author
|
@jdesrosiers i think you are very right on this all five files now hold the same 46 tests and differ only in |
vtushar06
commented
Aug 19, 2026
vtushar06
left a comment
Contributor
Author
There was a problem hiding this comment.
ready for final look.
jdesrosiers
approved these changes
Aug 24, 2026
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.
I walked the RFC 6901 section 3 grammar against the current
optional/format/json-pointer.json(40 tests) and found seven distinct cases the suite does not have anywhere, each of which can catch a wrong implementation the existing tests let through. All seven are handled correctly by ajv-formats 3.0.1 (full and fast) and python-jsonschema 4.25.1, so they do not break the dominant validators - they close real gaps.Changes
Seven tests added to
tests/*/optional/format/json-pointer.json(draft6, draft7, draft2019-09, draft2020-12). Control, DEL, and fullwidth characters are stored as\uXXXXescapes, the same way the existing NUL/LF/TAB test does.Character-class boundaries (a hand-rolled
unescapedcharacter class with an off-by-one flips these):/01(valid) - a leading-zero index-looking token is a valid string. The leading-zero ban in section 4 is about resolving anarray-index, not section-3 string validity. The suite has/foo/0but no multi-digit leading-zero token./\u007f(valid) - DEL, the first code point of the third range%x7F-10FFFF. The suite covers%x00-1Fand an astral char, but nothing pins the%x7E(~)/%x7Fboundary./}(valid) -}is%x7D, the top of the middle range%x30-7D, one code point below the excluded~(%x7E). The suite has|(%x7C, in/g|h) but not}, so a class written[\x30-\x7C ...]ships the off-by-one silently.Escape and NUL handling:
/foo\u0000~(invalid) - a dangling~after an embedded NUL. An implementation that copies the string into a null-terminated buffer truncates at the NUL, sees/foo, and wrongly accepts. The existing NUL test is valid data, so a truncating implementation passes it./~0(invalid) - a~followed by a fullwidth digit zeroU+FF10. A~must be followed by ASCII0/1; a validator that completes the escape with a Unicode-aware digit test (\dwith the Unicode flag,Character.isDigit, ...) wrongly accepts it./~2does not catch this - an ASCII[01]check correctly rejects/~2yet can still accept/~0.Normalization resistance (section 3 does no normalization):
/~(valid) - a fullwidth tildeU+FF5Eis an ordinary token char, not the escape introducer~. A validator that applies NFKC before checking folds it to~and wrongly rejects it as a dangling escape.Alternate representation:
#/foo(invalid) - the section 6 URI-fragment form with a real pointer tail. The suite has#,#/,#a, but a validator that strips a leading#and validates the rest passes all three (it rejects a bare#) while accepting#/foo. Newtonsoft.Json.Schema 4.0.2 does exactly this.RFC References
#-fragment form is a separate representationI left out
//,///, and~01on purpose - PR #877 already declined those as redundant.