You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Model the local API Explorer fixtures without a key prefix hack #4721
The docs-builder- prefix on API keys in docs/_docset.yml exists only so this repo can preview API pages locally, and it should be modeled explicitly.
What is getting in your way
docs/_docset.yml declares its API fixtures as docs-builder-elasticsearch, docs-builder-kibana and so on. These are copies of product specs for isolated preview. The assembler also loads this checkout, and two docsets that declare the same API key produce a Duplicate API key error in DiscoverApiOwners. The prefix avoids that error, and several places then special-case it:
IsolatedApiAliases.IsFixtureKey and IsolatedApiAliases.UrlKey in src/Elastic.ApiExplorer/Infrastructure/IsolatedApiAliases.cs recognize and strip the prefix.
OpenApiGenerator.ApiConfigsToRender skips the keys in the assembler and shortens them in isolated builds.
The declared key and the URL key differ in this one repo. An api: elasticsearch toc entry from Mount API pages in the navigation of isolated builds matches the short key, not the declared one, which is easy to get wrong.
What would you like instead
A fixture is a declared concept and not a naming convention. For example, an api: entry could carry a flag such as fixture: true, or the fixtures could move out of the product namespace. Then the assembler can skip them without reading a prefix, and isolated builds can serve them under their normal key.
Whatever shape wins, the key in docset.yml and the key in the URL should be the same string.
Activity