Skip to content

test(format/uri): add strict percent-encoding syntax and non-ASCII character cases#956

Open
AcEKaycgR wants to merge 1 commit into
json-schema-org:mainfrom
AcEKaycgR:uri-percent-encoding-validation
Open

test(format/uri): add strict percent-encoding syntax and non-ASCII character cases#956
AcEKaycgR wants to merge 1 commit into
json-schema-org:mainfrom
AcEKaycgR:uri-percent-encoding-validation

Conversation

@AcEKaycgR

Copy link
Copy Markdown
Contributor

Applies to: draft-v1, draft-04, draft-06, draft-07, draft/2019-09, draft/2020-12

Adds 12 new cases validating strict percent-encoding syntax triplets, caret/hash delimiters, and non-ASCII character constraints in the uri format.

Added:

  • Incomplete percent-encoding % + 1 digit in query (invalid)
  • Invalid hex digit %G0 in query (invalid)
  • Lone percent % in query (invalid)
  • Raw non-ASCII characters in query (invalid)
  • Caret ^ in query (invalid)
  • Incomplete percent-encoding % + 1 digit in fragment (invalid)
  • Invalid hex digit %G0 in fragment (invalid)
  • Lone percent % in fragment (invalid)
  • Second hash # in fragment (invalid)
  • Caret ^ in fragment (invalid)
  • Raw non-ASCII characters in fragment (invalid)
  • Valid percent-encoding in host reg-name (valid)

Ecosystem Impact (Triangulation):

Under Bowtie verification against 8 active implementations, these cases successfully caught live compliance issues:

  1. Go & PHP Bugs Caught: Both engines incorrectly accept incomplete percent-encoding ("%2"), invalid hex ("%G0"), and lone percents ("%") in queries and fragments.
  2. Go Bug Caught: go-gojsonschema incorrectly accepts raw non-ASCII é and carets in queries and fragments.
  3. Go Bug Caught: go-gojsonschema incorrectly rejects valid percent-encoding in host reg-names ("http://ex%61mple.com").

@jviotti @jdesrosiers @karenetheridge Ready for review.

@AcEKaycgR AcEKaycgR requested a review from a team as a code owner June 27, 2026 06:33
@AcEKaycgR AcEKaycgR force-pushed the uri-percent-encoding-validation branch from 7906fb6 to abe6809 Compare June 27, 2026 06:37
@AcEKaycgR AcEKaycgR force-pushed the uri-percent-encoding-validation branch from abe6809 to 7f0dd9a Compare June 27, 2026 06:39

@jviotti jviotti left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. I would have said some tests are very similar to others around percentage encoding, but I think we should accept them as-is if you managed to prove existing implementations break with them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants