Skip to content

Show the minor release in API docs, such as 9.6 and 8.19 - #5019

Merged
reakaleek merged 9 commits into
mainfrom
api-docs-minor-version-f7a9a34b
Nov 23, 2026
Merged

reakaleek merged 9 commits into
mainfrom
api-docs-minor-version-f7a9a34b

Conversation

@reakaleek

@reakaleek reakaleek commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

The API landing page now names the minor release it renders from, such as 9.6, and an older major's badge reads Version 8.19 instead of Version 8.

Affects: API reference

Prompt summary: Show the actual minor version in the API docs, and find out whether our data has it. The version index has it. The specs do not.

Why

Readers see v9 and v8 but not which minor release a page documents. The version index already maps each major to a minor branch (9 to 9.6, 8 to 8.19, ECE 3 to 3.8), but only the spec's object key used it. The specs cannot supply it: info.version is empty for Elasticsearch and Kibana and a constant 1 for ECE, so the landing "Version" fact was hidden or wrong.

What

Landing "Version" fact

The fact shows the minor release of the tree being viewed, and falls back to the spec's info.version only when the index names no minor. Elasticsearch shows 9.6, and ECE no longer shows 1.

Older-major badge and notice

The badge beside the title reads Version 8.19. A major with no minor in the index keeps Version 8.

Where the minor comes from

ApiVersions.ReleaseOf accepts a major.minor branch and returns null for main, master, a bare major, or a patch version. OpenApiGenerator sets ApiRenderContext.Release from each tree, next to Moniker, so the minor still shows when only one version renders and the switcher is empty. The branch must be digits on both sides of the dot. URLs and switcher labels stay on majors, so navigation does not change.

The API Explorer guide

The guide in docs/data/openapi/api-explorer.md names the minor release in the notice table and the badges row, and says what the label and the landing fact show when only one version renders or when the index names no minor.

Verify

mise run test
# ReleaseOf_Branch_NamesOnlyAMajorMinorRelease, For_OlderMajorWithRelease_BadgeNamesTheMinor
mise run serve
# /api/elasticsearch/ shows 9.6, /api/elasticsearch/v8/ shows 8.19, /api/cloud-enterprise/v3/ shows 3.8

Out of scope: the version dropdown still lists majors only. A minor beside each option is a separate UX call.

Risk: the value is the spec branch the page renders from. A spec repo can cut a minor branch before that minor ships, so the label can name an unreleased minor for a few weeks.

Check on the preview

The version index already maps each major to a minor branch, but only the spec's object key used it. The landing "Version" fact and the older-major badge now name the minor. Specs cannot supply it: `info.version` is empty for Elasticsearch and Kibana and a constant `1` for ECE.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@reakaleek
reakaleek requested a review from a team as a code owner November 23, 2026 18:52
@reakaleek
reakaleek requested a review from akira28 November 23, 2026 18:52
reakaleek and others added 3 commits November 23, 2026 19:59
`int.TryParse` also accepts a sign and surrounding white space, so a branch such as `8.-19` showed as a release instead of falling back to the major. `ApiVersions.ReleaseOf` now requires digits only. Raised in review of #5019.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The version notice snapshots never read the fact, so reverting it to `info.version` left every test green. The fact now has its own snapshot: the indexed minor on the versionless URL, `/v9/` and `/v8/`, and the spec version on `/next`. Raised in review of #5019.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The release rode on the version switcher, which is empty when a single spec loads, so a lone `3 → 3.8` tree fell back to `info.version` (`1` for ECE) and a lone older major lost its minor badge. `ApiRenderContext.Release` now carries it from the tree, like `Moniker`, and the switcher no longer knows about releases. Raised in review of #5019.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

The guide still said an older major shows `Version 8`. It now says the label and the landing `Version` fact name the indexed minor, such as `8.19`, with or without a version picker, and fall back to the major when the index names none. Raised in review of #5019.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comment thread docs/data/openapi/api-explorer.md Resolved
…lorer guide

The guide mixed two rules. The landing `Version` fact shows on every tree. The older-major label shows only on older majors, and the newest major and `main` at `/next/` have none. Raised in review of #5019.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comment thread docs/data/openapi/api-explorer.md Resolved
Comment thread docs/data/openapi/api-explorer.md Resolved
reakaleek and others added 2 commits November 23, 2026 20:20
The guide promised the fact on every tree, but a `/next/` or bare-major landing page omits it when the spec's `info.version` is empty. It now says only that the picker does not decide whether the fact appears. Raised in review of #5019.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The guide said the label shows only on older majors, but a non-default moniker such as `beta` renders `Version beta` at `/api/<key>/vbeta/`. It now names older majors as the usual case and the `beta` case as the other. Raised in review of #5019.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comment thread docs/data/openapi/api-explorer.md Resolved
The guide's `Version beta` example was wrong for a `beta` entry that points to a `major.minor` branch such as `9.6`, which reads `Version 9.6`. The paragraph now states the rule once: the label names the minor when the entry points to a `major.minor` branch, and the moniker otherwise. Raised in review of #5019.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@reakaleek
reakaleek merged commit 5d37903 into main Nov 23, 2026
44 checks passed
@reakaleek
reakaleek deleted the api-docs-minor-version-f7a9a34b branch November 23, 2026 19:40
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