Skip to content

fix: update all schema links to use absolute URLs#89

Merged
bokelley merged 2 commits into
mainfrom
bokelley/fix-schema-link
Oct 8, 2025
Merged

fix: update all schema links to use absolute URLs#89
bokelley merged 2 commits into
mainfrom
bokelley/fix-schema-link

Conversation

@bokelley

@bokelley bokelley commented Oct 4, 2025

Copy link
Copy Markdown
Contributor

Summary

Fixes broken schema links throughout the documentation by using relative URLs that Docusaurus handles correctly.

Problem

When clicking on schema links in the documentation (e.g., "Request Schema" links), users were encountering broken links on the production site.

Solution

Updated all schema links to use relative URLs (/schemas/v1/...) instead of absolute URLs. Docusaurus automatically:

  1. Recognizes these as static asset references
  2. Copies them to the build with content hashing (e.g., /assets/files/create-media-buy-request-{hash}.json)
  3. Updates href attributes automatically

Benefits

Works in development: Links point to local schemas when running npm run start
Works in production: Links point to production schemas on deployed site
Automatic cache busting: Content hashes ensure fresh schemas after updates
No URL hardcoding: No need to maintain environment-specific URLs

Changes

  • Updated 13 documentation files across signals, media-buy, protocols, and reference sections
  • Changed schema link references to use relative URLs
  • All tests pass after changes

Test Plan

  • All schema validation tests pass
  • All example validation tests pass
  • TypeScript compilation succeeds
  • Build completes successfully
  • Verified links work in built output (checked with npm run serve)
  • Confirmed Docusaurus transforms links correctly

🤖 Generated with Claude Code

- Changed absolute schema links (https://adcontextprotocol.org/schemas/v1/...) to relative URLs (/schemas/v1/...)
- Docusaurus automatically handles these as static assets with content hashing
- Works correctly in both development and production environments
- Links now point to local schemas in dev and production schemas in prod
- Affects all task reference documentation, data models, and protocol docs

Testing confirmed:
- Docusaurus converts /schemas/v1/... to /assets/files/{filename}-{hash}.json
- Links work in both npm run start (dev) and production builds
- Build completes without broken link warnings

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@bokelley bokelley force-pushed the bokelley/fix-schema-link branch from 8e4b7a5 to 38f97e5 Compare October 4, 2025 12:46
- Changed onBrokenMarkdownLinks from 'warn' to 'throw'
- This ensures broken markdown anchor links will fail the build
- Prevents broken links from reaching production
- Aligns with onBrokenLinks: 'throw' for consistent link validation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@bokelley bokelley merged commit e0b9232 into main Oct 8, 2025
4 checks passed
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.

1 participant