Skip to content

Fix relative schema urls#990

Open
wolveix wants to merge 3 commits intomainfrom
fix-relative-schema-urls
Open

Fix relative schema urls#990
wolveix wants to merge 3 commits intomainfrom
fix-relative-schema-urls

Conversation

@wolveix
Copy link
Collaborator

@wolveix wolveix commented Mar 9, 2026

Fixes #983.

There's an ongoing discussion in that issue regarding my suggestion to always use absolute URLs rather than relative URLs for the generated $schema field.

Would appreciate additional input, particularly from @danielgtaylor and @leonklingele :)

@codecov
Copy link

codecov bot commented Mar 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.13%. Comparing base (99e60fd) to head (5b3c3f1).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #990      +/-   ##
==========================================
+ Coverage   93.08%   93.13%   +0.05%     
==========================================
  Files          23       23              
  Lines        4769     4781      +12     
==========================================
+ Hits         4439     4453      +14     
+ Misses        270      269       -1     
+ Partials       60       59       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@leonklingele leonklingele left a comment

Choose a reason for hiding this comment

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

Small nit, otherwise lgtm! 🚀


serverURL, err := url.Parse(server.URL)
if err != nil {
continue
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we panic here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, the thought did cross my mind. Furthering my original question, I wonder if we should hard reject relative URLs? My thought being that we're currently adding a dummy URL to the $schema field for relative URLs, but maybe we should just force people to always use absolute URLs from the start?

I suspect that's not necessary, just trying to mentally untangle it :)

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.

Are relative URLs still supported?

2 participants