Repository navigation
docs(routes): show full requests and truncated responses in FX samples - #1141
letstokenize wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
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:
assertKnownin 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, dynamicbody/params, and invalid JSON.- The fx.mdx embeds pass only
account,pairIndex,tokensandsponsorId, 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.
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
OpenApi.Playgroundtakesparams(path values),queryandbody(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.<PLACEHOLDER>values.These Playground defaults apply to all 24
OpenApi.Playgroundembeds across the site.Checks
pnpm check,pnpm check:types,pnpm test(1,702 passed),pnpm build,pnpm check:markdown/docs/routes/fxin a browser: all 7 samples show the full request with truncated responses, and Try prefills the transfer body/docs/routes/fx.mdtwin: the presets render in its curl and fetch samples