Skip to content

docs(routes): show full requests and truncated responses in FX samples - #1141

Open
letstokenize wants to merge 2 commits into
mainfrom
docs/routes-fx-playground-samples
Open

letstokenize wants to merge 2 commits into
mainfrom
docs/routes-fx-playground-samples

Conversation

@letstokenize

Copy link
Copy Markdown
Contributor

Makes every request sample on the FX swap guide use the same OpenAPI Playground format: the full request is shown, and the response is truncated with a toggle.

Changes

  • Vocs patch. OpenApi.Playground takes params (path values), query and body (JSON) presets. Embeds now show the full request (no collapsed query or body), and responses show 12 lines with a "Show N more lines" toggle. Preset embeds drop optional query parameters the preset doesn't name. The Try panel and Markdown twins use the same presets.
  • FX guide. Check the account, Create the transfer, Prepare the change, and Name a pair or list now use Playground embeds with real example values in place of hand-written curl blocks with <PLACEHOLDER> values.

These Playground defaults apply to all 24 OpenApi.Playground embeds across the site.

Checks

  • pnpm check, pnpm check:types, pnpm test (1,702 passed), pnpm build, pnpm check:markdown
  • Checked /docs/routes/fx in a browser: all 7 samples show the full request with truncated responses, and Try prefills the transfer body
  • Checked the /docs/routes/fx.md twin: the presets render in its curl and fetch samples

@vercel

vercel Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
tempo-docs Ready Ready Preview Nov 14, 2026 1:00am UTC

Request Review

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing blocking. The comments below are optional suggestions. There is no need to push a fix for them before merging.

Comment thread patches/vocs@2.12.0.patch Resolved
Comment thread src/lib/markdown-output.ts Resolved

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both of my earlier inline points are fixed in 90cae21, and I found no new bugs. The Vocs patch still changes how all 24 OpenApi.Playground embeds across the site render, so a human look at it would still be worthwhile.

What was reviewed:

  • assertKnown in query-presets (src and dist) now throws on unknown path or query names, and on a body sent to an operation that has none. The new markdown-output.test.ts cases cover those errors, dynamic body/params, and invalid JSON.
  • The fx.mdx embeds pass only account, pairIndex, tokens and sponsorId, plus JSON bodies. The prose names the example addresses readers should replace.
  • I didn't run the tests, the build or check:markdown. I only read the diff.
Extended reasoning...

The change grows patches/vocs@ 2.12.0.patch by about 600 lines. It covers preset parsing, code samples, CodeSample.client and the Playground UI, in both src and dist. It also updates the lockfile hash, the Markdown renderer and its tests, and the FX guide. It touches no security-sensitive surface: no auth, no secrets and no injection paths, just documentation rendering. The latest commit fixes both findings from the previous review, with tests. I'm deferring rather than approving because the vendored UI patch is large and changes rendering site-wide, including response truncation and dropping optional query parameters.

This branch was successfully deployed

1 active deployment
Preview — 90cae21c Deployed Nov 14, 2026 by vercel[bot]
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.

1 participant