Repository navigation
Share one base class for API page sidebar entries - #4630
Merged
akira28 merged 1 commit intoOct 29, 2026
Merged
Conversation
The sidebar entries of operation, type, topic, and Authentication or Servers pages each wrote out the same leaf members, with Id derived from the URL. They now extend ApiPageNavigationItem and only decide their URL. The generated API output is byte-identical. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
theletterf
approved these changes
Oct 29, 2026
This was referenced Oct 29, 2026
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 sidebar entries of API operation, type, topic, and Authentication or Servers pages now extend one base class and only decide their own URL. Nothing renders differently.
Affects: Internals only
Prompt summary: Share more code between the Topics and Types parts of the API sidebar. Most of what the two still repeat is in the sidebar entry of each page, which every API page kind wrote out by hand. That refactor touches classes from before the topics work, so it comes as its own PR on top of the stack.
Stack: 3 of 3, on top of #4629, which is on top of #4628. Merge those first.
Why
Four sidebar entry classes repeat the same eight members: the navigation root, the model, the URL, the title, whether the entry is hidden, the parent, the navigation index, and an id derived from the URL. Only the URL differs between them. A change to how API page entries behave has to be made four times.
What
One base for page entries
ApiPageNavigationItem<TModel>holds the shared members. Operation, type, topic, and Authentication or Servers entries extend it and pass in their URL and title. Their public constructors keep their signatures, so no caller changes.Hidden stays where it was
Entries are visible unless they say otherwise. The Authentication and Servers entry stays hidden by default, and the Authentication page built from a topic stays listed.
Hiddenis now set only at construction, which matches how every caller already used it.Verify
dotnet test tests/Elastic.ApiExplorer.Tests/A build of all API products from the live specs with this branch and with #4629 produces byte-identical output.