test: add exhaustive uri format cases across drafts#895
Open
AcEKaycgR wants to merge 1 commit intojson-schema-org:mainfrom
Open
test: add exhaustive uri format cases across drafts#895AcEKaycgR wants to merge 1 commit intojson-schema-org:mainfrom
AcEKaycgR wants to merge 1 commit intojson-schema-org:mainfrom
Conversation
f4660d1 to
9407fb8
Compare
jviotti
approved these changes
Apr 20, 2026
Member
jviotti
left a comment
There was a problem hiding this comment.
I spent some time today on this. Lots of tests, but as far as I could tell, all of them are RFC compliant. I couldn't catch anything non compliant, though I would love reviews from other TSC members knowledgeable in URIs, like @jdesrosiers (as you also have your own URI implementation).
Given the low coverage we have on these things, I think this is a great addition, and we can always continue incrementally polishing it with more edge cases.
Contributor
Author
|
Thanks @jviotti Will keep looking for more edge cases and open up PR as things surface. Also starting to work through the other formats simultaneously . |
7 tasks
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.
This PR expands the
uriformat test suite across all drafts. The expansion provides complete coverage of RFC 3986 ABNF and prose constraints. Every test was traced directly against RFC 3986 , not derived from implementation output.Technical Coverage Details
The new cases cover every structural dimension of the grammar:
%x41-5A / %x61-7A), rejection of invalid characters (~,=,/, space),%-encoding forbidden in scheme, empty-before-colon, and missing colon.%, incomplete triplets, and%-encoding forbidden in port.@split (guards against last-@scanning bugs), slash and?boundary tests.::form; IPvFuture with uppercaseV; rejection of two::, >4 hex digits in h16, wrong group counts, misformed IPvFuture, and non-ASCII in host.*DIGIT- empty port, leading zeros, no upper bound, rejection of+,-, space,., alpha characters, pct-encoded digits, and Unicode decimal digits.{,},^,`,|,\,",<,>), control characters, and non-ASCII; dot and double-dot segments./+?; at-sign valid in both; rejection of[,],{,^, space, and second#in fragment; pct-encoding valid/invalid; empty and absent forms.//) and path-only relative-refs correctly rejected ,format: "uri"requires an absolute URI with scheme.Standards & Traceability
Following the style of
ipv4.json, non-obvious tests carry acommentfield mentioning the relevant RFC 3986 section and ABNF production.Triangulation note: Spot-checked against ajv-formats and python-jsonschema-format. All mismatches reflect implementation gaps against strict RFC 3986 ABNF, not errors in the test vectors.
Feedback appreciated @jviotti @jdesrosiers @karenetheridge