Keep the SDK-only caveat out of variant summaries - #154
Merged
Conversation
The summary of a derived fragment operation is what the developer site renders as the page title and H1. Prefixing the SDK-only caveat onto it made "SDK-only logical operation. HTTP clients must call the base path; the URL fragment is not sent." the title of the platform-chat-create-stream page instead of the operation's own name. The variant summary now falls back to the parent summary unprefixed, and a variant can declare its own summary and description so a fragment operation can carry a title distinct from its parent's. The caveat still leads the description, where it reads as prose rather than a heading; it describes the fragment path itself, so it applies even when the variant overrides the description. Co-authored-by: Chris Freeman <chris-freeman-glean@users.noreply.github.com>
chris-freeman-glean
marked this pull request as ready for review
September 10, 2026 15:00
chris-freeman-glean
deleted the
cfreeman/sdk-variant-summary-h1-55bc
branch
September 10, 2026 15:00
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.
Problem
platform-chat-create-stream is titled "SDK-only logical operation. HTTP clients must call the base path; the URL fragment is not sent." instead of the name of the operation.
prefixSdkOnlyDocsinsrc/source-spec-transformer.jsprepended that caveat onto both thesummaryand thedescriptionof every derived fragment variant. The summary is what the developer site renders as the page title and H1, so the boilerplate replaced the title.Change
applySdkVariantDocsreplacesprefixSdkOnlyDocs:summary; otherwise the parent summary carries over unchanged.platformSdkVariantKeysgainssummaryanddescription, each validated as a non-empty string when present.Live verification against the Platform variant summary
Verified end to end by feeding
openapi/public/platform/chat.yamlfrom askscio/scio at commit10b689f4fb17c052f2b09740ded75c75d04cb072(blobb8dd28b6cb5e82bcce81e3091440ea0cfc1981f2, PR askscio/scio#285668, still open) into this branch's transformer atc3059f7929f404db992f1101cdf8cc427a45b4d0, then running the glean-developer-site Platform OpenAPI pipeline (openapi-capitalize-language→openapi-server-url→docusaurus gen-api-docs platform) and rendering locally./api/chat#stream(platform-chat-create-stream)/api/chat(platform-chat-create)The SDK-only caveat now appears only in the streaming page's description prose, never in its title.
Sequencing
This PR is code and tests only. No
final_specs, Speakeasy, or developer-site output is regenerated here, and nothing above was published.Platform's per-variant
summary: Create a streaming chat responseis not merged yet. Once it lands, the streaming page picks up its own distinct title throughvariant.summarywith no further change to this transformer, and the spec republish plus developer-site redeploy can follow.Until then, the streaming page inherits the parent's "Create a chat response" — the same title as the non-streaming page, but a real operation title rather than boilerplate.
One follow-up lives outside this repo:
sidebars.tsin glean-developer-site still carries a hardcoded label containing the old boilerplate for this doc id, andpnpm sidebar:fixdoes not rewrite label text. It is inert today because the generated page'ssidebar_labelfrontmatter wins at render time (confirmed in the built sidebar payload and the screenshots above), but it is stale text worth cleaning up there.Testing
pnpm test— 120 passed across 5 files.pnpm lint— clean.summaryanddescriptionoverrides.