Skip to content

API Explorer: serve the newest major at the versionless URL and move main to /next - #4971

Merged
reakaleek merged 16 commits into
mainfrom
api-default-major-next-898caabb
Nov 20, 2026
Merged

reakaleek merged 16 commits into
mainfrom
api-default-major-next-898caabb

Conversation

@reakaleek

@reakaleek reakaleek commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Why

  • /docs/api/<key> serves the unreleased main spec today, so readers and search engines get unreleased APIs as the default answer.
  • The newest released major has only a numbered URL (/v9), and nothing states which version the versionless URL serves after a major release.
  • This implements alternative A of the RFC: Default version and indexing rules for the API docs.

Closes elastic/docs-eng-team#1126

What

  • For versioned APIs, /api/<key> serves the newest released major. The same major stays at /api/<key>/v<N>, older majors stay at /api/<key>/v<N>, and main moves to /api/<key>/next.
  • Versionless APIs (for example elasticsearch-serverless) do not change. A versioned API with no numbered major keeps main at /api/<key>.
  • links.json marks the newest major as current with root api/<key>. main is hidden with root api/<key>/next. A new optional mirror_root names the numbered copy, so links to /api/<key>/v9/... still validate.
  • next is a reserved segment. A child page or a version named next fails the build with an error.
  • The API catalog and the API switcher link to the versionless URL, because it now serves the newest major.
  • Cross-links on a host that still serves bump.sh keep working: a link to the newest major, named or not, goes to its /v<N> path, and a link that names main reaches /api/doc/<key>, where bump.sh serves it.
  • The search export follows the same mapping: the newest major is the default tree at versionless URLs, and main documents point at /next.

Notes

  • Decisions D1 (RFC review) and D2 (/next as the segment) on elastic/docs-eng-team#1210 are still open. The segment is one constant (ApiUrlBuilder.NextSegment). Please do not merge before D1 closes.
  • A local spec file overrides only main. With docs-builder serve, a local spec edit now shows under /api/<key>/next, not at the versionless URL.
  • Not in this PR: version labels, canonical and robots values, the sitemap, and the removal of next from the search index (elastic/docs-eng-team#1215, elastic/docs-eng-team#1216, elastic/docs-eng-team#1217). mise run integrate did not run for the search export change.

🤖 Generated with Claude Code

reakaleek and others added 8 commits November 20, 2026 00:18
The newest released major takes the versionless URL, `main` moves to `next`, and each major keeps `v{N}`. The type has no callers yet. A `children:` page named `next` is now rejected, because it would shadow the `main` tree.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
For versioned APIs, `/api/<key>` and `/api/<key>/v<N>` now render the newest released major, and `main` moves to `/api/<key>/next`. `ApiVersionRoutes` is the one place that maps a version to its URLs: the generator, the floating section, `links.json`, the version picker, the catalog and the search export all read it, and `ApiUrlBuilder.ProductSuffix` is gone. Versionless APIs and APIs without a numeric major keep `main` at `/api/<key>`.

A version-index entry named `next` is reported as an error and left out. Supplemental files are validated once per version, so the `/v<N>` copy does not report them twice.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The newest major is served at both `/api/<key>` and `/api/<key>/v<N>`. A `FloatingLinkVersion` now carries an optional `mirror_root` for the second URL, and `ContainsSitePath` matches it, so a link to `/api/<key>/v<N>/...` no longer reads as a missing page. The field is omitted when empty, so older readers of `links.json` see no change.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Search scoping and the navigation swap now treat `/api/<key>/next/` as the unreleased tree. The index still names that tree `main`, so `parseApiTree` maps the segment back to it.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The catalog now opens `/docs/api/elasticsearch`, which serves the newest released major, and the first numbered link in the version picker is an older major. The steps already assert this; the comments now say so.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The version table, the picker text, cross-link resolution and the supplemental overlay now describe the new routing. The pages also note that a local spec edit shows under `/next/` in `serve`, and that `next` is a reserved slug and version name.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Callers read the position of a suffix in a list to tell the numbered
copy of the default major from its versionless root. ApiVersionRoutes
now names that copy, each tree says if it is the copy, and the frontend
reads the URL root of an API path from one function.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@reakaleek
reakaleek requested a review from a team as a code owner November 19, 2026 23:54
@reakaleek
reakaleek requested a review from akira28 November 19, 2026 23:54
@github-actions

Copy link
Copy Markdown
Contributor

Comment thread docs/data/openapi/api-explorer.md Resolved
reakaleek and others added 6 commits November 20, 2026 01:03
…fails (per Libra review)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…rsion (per Libra review)

On a host that still serves bump.sh, a link that names the newest major
keeps its numbered path, and a link that names main reaches the API root.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…or fails (per Libra review)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…view)

Leaving the version out of the export would delete its indexed documents.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
reakaleek and others added 2 commits November 20, 2026 01:15
…ops (per Libra review)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…or (per Libra review)

A link without a version is checked against the current version, so on
a host that serves bump.sh it now resolves under that version's numbered
path instead of the root, where bump.sh serves main.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@reakaleek reakaleek self-assigned this Nov 20, 2026
@reakaleek
reakaleek merged commit 30b31df into main Nov 20, 2026
44 checks passed
@reakaleek
reakaleek deleted the api-default-major-next-898caabb branch November 20, 2026 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant