Skip to content

docs(leagues): replace stale Leagues-by-Sport table with live-endpoint pointer (Item #3)#219

Merged
Mlaz-code merged 1 commit into
mainfrom
feat/leagues-doc-canonical-source
May 7, 2026
Merged

docs(leagues): replace stale Leagues-by-Sport table with live-endpoint pointer (Item #3)#219
Mlaz-code merged 1 commit into
mainfrom
feat/leagues-doc-canonical-source

Conversation

@Mlaz-code
Copy link
Copy Markdown
Collaborator

Summary

Closes the last of 4 drift traps named in [[League Normalization Next Steps]] §Item #3. After this lands: api-adapters#538 + sharp-api-go#367 + sharpapi-site#87 + this PR fully address the original wiki entry.

Problem

content/en/api-reference/leagues.mdx had a hand-maintained "Leagues by Sport" table with 16 entries across 8 sports — against the atlas registry's 600+ leagues across 30+ sports.

Two issues:

  1. Drift trap: required manual update on every registry addition. Coverage has been silently shrinking — soccer entries listed 5 leagues but the registry has 295.
  2. Wrong canonical IDs in the docs: showed epl, la_liga, serie_a, bundesliga, mls. None are the registry's canonical slug forms (england_-_premier_league, spain_-_la_liga, italy_-_serie_a, germany_-_bundesliga, usa_-_major_league_soccer). The API does accept short forms for backward compat, but /leagues returns canonical slugs and other endpoints emit them on response payloads. Clients copying the doc example saw their epl filter "work" but their response-side eventId come back containing england_-_premier_league and assumed our docs were lying.

Fix

Replace the static table with a "Common Leagues" callout that:

  • Is honest about being illustrative not exhaustive
  • Uses canonical slug form for soccer (the most affected sport)
  • Adds programmatic-access guidance ("never hard-code a list, call /api/v1/leagues") explicitly
  • Mentions registry breadth (600+ leagues / 30+ sports) so readers understand the table is a tiny subset

Diff

content/en/api-reference/leagues.mdx: 63 lines → 15 lines (the static 8-section table → a single illustrative table + callout). Net -48 lines, +15 lines.

Test plan

  • npm run build clean (full Next.js + Nextra static export, exit 0)
  • Vercel preview renders the new "Common Leagues" section correctly with the Callout

🤖 Generated with Claude Code

…t pointer

The hand-maintained "Leagues by Sport" table covered 16 leagues across
8 sports against the atlas registry's 600+ entries. Two problems:

1. Drift trap: required manual update on every registry addition.
   Last comprehensive ~12 months ago, silently shrinking in coverage
   relative to the actual catalog.

2. Wrong canonical IDs: showed `epl`, `la_liga`, `serie_a`,
   `bundesliga`, `mls` — none are the registry's canonical slug
   forms (`england_-_premier_league`, `spain_-_la_liga`,
   `italy_-_serie_a`, `germany_-_bundesliga`,
   `usa_-_major_league_soccer`). The API does accept short forms
   for backward compat, but `/leagues` returns the canonical slug
   and other endpoints emit it on response payloads — clients
   coding to the doc example see mismatches.

Replaced with a "Common Leagues" section that:

- Is honest about being illustrative not exhaustive
- Uses canonical slug form for soccer (the most affected sport)
- Adds programmatic-access guidance ("never hard-code a list, call
  /api/v1/leagues") in the callout
- Mentions registry breadth (600+ leagues / 30+ sports) so readers
  understand the table is a tiny subset

Closes the last of 4 drift traps in League Normalization Item #3
(api-adapters#538, sharp-api-go#367, sharpapi-site#87, this PR).
@Mlaz-code Mlaz-code merged commit c7a759e into main May 7, 2026
@Mlaz-code Mlaz-code deleted the feat/leagues-doc-canonical-source branch May 7, 2026 23:48
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