Skip to content

Keep the SDK-only caveat out of variant summaries - #154

Draft
chris-freeman-glean wants to merge 1 commit into
mainfrom
cfreeman/sdk-variant-summary-h1-55bc
Draft

Keep the SDK-only caveat out of variant summaries#154
chris-freeman-glean wants to merge 1 commit into
mainfrom
cfreeman/sdk-variant-summary-h1-55bc

Conversation

@chris-freeman-glean

@chris-freeman-glean chris-freeman-glean commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

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.

prefixSdkOnlyDocs in src/source-spec-transformer.js prepended that caveat onto both the summary and the description of 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

applySdkVariantDocs replaces prefixSdkOnlyDocs:

  • The summary is never prefixed. A variant may declare its own summary; otherwise the parent summary carries over unchanged.
  • The caveat still leads the description, where it reads as prose rather than a heading. It describes the fragment path itself rather than the source text, so it applies even when a variant overrides the description.
  • platformSdkVariantKeys gains summary and description, 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.yaml from askscio/scio at commit 10b689f4fb17c052f2b09740ded75c75d04cb072 (blob b8dd28b6cb5e82bcce81e3091440ea0cfc1981f2, PR askscio/scio#285668, still open) into this branch's transformer at c3059f7929f404db992f1101cdf8cc427a45b4d0, then running the glean-developer-site Platform OpenAPI pipeline (openapi-capitalize-languageopenapi-server-urldocusaurus gen-api-docs platform) and rendering locally.

Operation H1 / sidebar
/api/chat#stream (platform-chat-create-stream) Create a streaming chat response
/api/chat (platform-chat-create) Create a chat response

The SDK-only caveat now appears only in the streaming page's description prose, never in its title.

platform-chat-create-stream rendered with H1 and sidebar reading Create a streaming chat response

platform-chat-create rendered with H1 and sidebar reading Create a chat response

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 response is not merged yet. Once it lands, the streaming page picks up its own distinct title through variant.summary with 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.ts in glean-developer-site still carries a hardcoded label containing the old boilerplate for this doc id, and pnpm sidebar:fix does not rewrite label text. It is inert today because the generated page's sidebar_label frontmatter 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.

  • Updated the two tests that asserted the concatenated summary.
  • Added a test for variant summary and description overrides.
  • Added a test rejecting a non-string variant summary.
Open in Web Open in Cursor 

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants