Skip to content

test(format/uri): add port syntax limits and empty host/userinfo boundary cases#958

Open
AcEKaycgR wants to merge 1 commit into
json-schema-org:mainfrom
AcEKaycgR:uri-port-userinfo-boundaries
Open

test(format/uri): add port syntax limits and empty host/userinfo boundary cases#958
AcEKaycgR wants to merge 1 commit into
json-schema-org:mainfrom
AcEKaycgR:uri-port-userinfo-boundaries

Conversation

@AcEKaycgR

Copy link
Copy Markdown
Contributor

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

Adds 11 new cases validating port boundaries, empty host/userinfo scanning limits, and host reg-name character compatibility.

Added:

  • Invalid colons in port :8:0 and :: (invalid)
  • Empty port with colon (valid)
  • Port with no upper bound (valid)
  • Empty host with explicit port (valid)
  • Empty userinfo @ (valid)
  • Userinfo with empty host (valid)
  • Sub-delimiters in host reg-name (valid)
  • Host reg-name ending in a dot (valid)
  • Tilde in host reg-name (valid)
  • Underscore in host reg-name (valid)

Ecosystem Impact (Triangulation):

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

  1. Go Bug Caught: go-gojsonschema incorrectly accepts invalid colons in port.
  2. PHP Bug Caught: php-opis-json-schema incorrectly rejects empty ports, ports with no upper bound, empty host with port, empty host with userinfo, sub-delimiters, trailing dots, tildes, and underscores in host reg-names.

@jviotti @jdesrosiers @karenetheridge Ready for review.

@AcEKaycgR AcEKaycgR requested a review from a team as a code owner June 27, 2026 06:34
@AcEKaycgR AcEKaycgR force-pushed the uri-port-userinfo-boundaries branch 2 times, most recently from 91aca09 to dd11e1d Compare June 27, 2026 06:39
"valid": false
},
{
"description": "above-ceiling DIGIT in port: colon is %x3A, one above 9 (%x39)",

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.

Not sure I follow this description. What 9 are you referring to?

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.

Ahhh OK you mean at the ASCII level. I think it can be clarified a bit more probably, as its not a DIGIT anymore?

"valid": false
},
{
"description": "port digit boundary: one above range (colon)",

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.

I think this description can be improved too. It took me a while to understand it, at least me

@AcEKaycgR AcEKaycgR force-pushed the uri-port-userinfo-boundaries branch from dd11e1d to 9d0fd09 Compare July 1, 2026 05:13
@AcEKaycgR

Copy link
Copy Markdown
Contributor Author

Hi @jviotti,

I've renamed both test descriptions to make them much simpler and clearer:

  1. "port digit boundary: one above range (colon)""multiple colons in port is invalid"
  2. "above-ceiling DIGIT in port: colon is %x3A...""colon in port is invalid"

Thanks for the feedback.

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