Skip to content

Show the root route as / in the API request line - #4909

Merged
reakaleek merged 2 commits into
mainfrom
fix-logstash-get-request-87277263
Nov 17, 2026
Merged

reakaleek merged 2 commits into
mainfrom
fix-logstash-get-request-87277263

Conversation

@reakaleek

@reakaleek reakaleek commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

The request line of an API operation on the root route now reads GET /. It showed the method and an empty path.

Affects: API reference

Prompt summary: The Logstash root operation page on the edge site shows GET where GET / belongs. The ask is to confirm the defect, find every other place with the same effect, and fix it.

Why

A route of / has no path segments. The request line writes the path one segment at a time, so it writes nothing for the root. The Logstash GET / page shows it, and so do the Elasticsearch GET / and HEAD / pages and the rows for those operations on their group pages. The copy button next to the empty line already copies GET /, because it reads the route string.

What

Root route in the request line

A row with no segments now renders / as its path. Rows with segments render as before. The operation page and the group page share one partial, _EndpointPath, so one change covers both.

Test for the rendered partial

Render_RootRoute_ShowsSlash renders _EndpointPath for GET / and compares the markup with an inline snapshot. The existing endpoint tests compare the route string, which was always correct, so they did not see the empty path.

Out of scope — a route with a trailing slash such as /foo/ still displays as /foo. The Logstash 9.5 and Elasticsearch specs have no such route.

Verify

dotnet test --project tests/Elastic.ApiExplorer.Tests
# Render_RootRoute_ShowsSlash — fails on the first commit, passes on the second
mise run serve

Open http://localhost:3000/api/doc/logstash/v9/operation/operation-root.

Check on the preview

🤖 Generated with Claude Code

reakaleek and others added 2 commits November 17, 2026 19:57
The request line of an operation on `/` renders the method and an empty
path. This test pins the expected `/` and fails until the next commit.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
An operation on `/` has no path segments, and `_EndpointPath` wrote the
path one segment at a time. The request line showed the method and an
empty path. The partial now writes `/` when a row has no segments.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@reakaleek
reakaleek requested a review from a team as a code owner November 17, 2026 19:02
@reakaleek
reakaleek requested a review from Mpdreamz November 17, 2026 19:02
@reakaleek reakaleek added the bug label Nov 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

@reakaleek
reakaleek merged commit fb70b1b into main Nov 17, 2026
50 checks passed
@reakaleek
reakaleek deleted the fix-logstash-get-request-87277263 branch November 17, 2026 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant