Skip to content

Serve the docs API's OpenAPI paths relative to www.elastic.co/docs/_api/v1 - #4943

Merged
akira28 merged 1 commit into
mainfrom
feature/docs-api-server-base-path
Nov 18, 2026
Merged

akira28 merged 1 commit into
mainfrom
feature/docs-api-server-base-path

Conversation

@akira28

@akira28 akira28 commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

The docs API's OpenAPI document now names https://www.elastic.co/docs/_api/v1 as its server, and its paths are relative to it: /search, /apis/{api}/operations/{operationId}, and so on.

Affects: API, API Explorer

Prompt summary: Change the base URL of the docs API's OpenAPI document to www.elastic.co/docs/_api/v1.

Why

The server was https://www.elastic.co, so every path repeated /docs/_api/v1. In API Explorer the base URL fact showed only the host, and each operation's route carried the mount point. The version and mount point belong to the base URL, which is how the other specs in API Explorer read.

What

  • ApiExamples: Origin (https://www.elastic.co) and BasePath (/docs/_api/v1) make up Server. Curl samples still call the full URL, so they don't change.
  • Document transformer: after setting the server, RelativizePaths strips BasePath from every path.
  • Tests: OpenApiDocumentTests checks the new server and that no path starts with /docs. The test that lists every operation now expects relative paths. The curl route test needs no change: it already matches server + path.

Routes the API serves don't change. Only the document describes them differently.

Verify

dotnet test --project tests/Elastic.Documentation.Api.Tests   # 320 pass

Follow-up: #4897's copy, docs/docs-api.json, needs regenerating after this merges.

🤖 Generated with Claude Code

@akira28
akira28 requested a review from a team as a code owner November 18, 2026 13:55
@akira28
akira28 requested a review from theletterf November 18, 2026 13:55
@github-actions

Copy link
Copy Markdown
Contributor

@akira28
akira28 merged commit ecddd9e into main Nov 18, 2026
50 checks passed
@akira28
akira28 deleted the feature/docs-api-server-base-path branch November 18, 2026 14:10
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