Repository navigation
Serve the docs API's OpenAPI paths relative to www.elastic.co/docs/_api/v1 - #4943
Merged
Merged
Conversation
…pi/v1 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
Docs preview (local build)Handbook preview: https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/4943/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The docs API's OpenAPI document now names
https://www.elastic.co/docs/_api/v1as 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) andBasePath(/docs/_api/v1) make upServer. Curl samples still call the full URL, so they don't change.RelativizePathsstripsBasePathfrom every path.OpenApiDocumentTestschecks 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 matchesserver + path.Routes the API serves don't change. Only the document describes them differently.
Verify
Follow-up: #4897's copy,
docs/docs-api.json, needs regenerating after this merges.🤖 Generated with Claude Code