fix(docs): include API key header in generated code samples - #6630
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryLow Risk Overview The docs API page wires Fumadocs’ Build-time guards: all OpenAPI spec files must agree on default security; unsupported or missing schemes throw with clear Reviewed by Cursor Bugbot for commit 03b74c2. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryThe PR adds authentication headers to generated OpenAPI code samples while retaining Fumadocs’ built-in language registry.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| apps/docs/app/[lang]/[[...slug]]/page.tsx | Connects authenticated code-sample generation to the OpenAPI page configuration. |
| apps/docs/lib/openapi-code-samples-client.ts | Wraps built-in client-side generators and merges resolved authentication headers into request data. |
| apps/docs/lib/openapi-code-samples.ts | Recreates Fumadocs’ default generator metadata with authenticated wrapper functions. |
| apps/docs/lib/openapi.ts | Resolves shared and operation-level security requirements into headers and preserves default samples for anonymous operations. |
Reviews (2): Last reviewed commit: "fix(docs): include API key header in gen..." | Re-trigger Greptile
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 03b74c2. Configure here.
Summary
401generateCodeSamplesto wrap each built-in language generator and prepend the operation's auth headers, resolved fromoperation.security(falling back to document-level security) againstcomponents.securitySchemesType of Change
Testing
Tested manually against
next dev— cURL, JavaScript, Go, Python, Java and C# all emitX-API-Key: YOUR_API_KEYon SSR and after client-side navigation, verified onGET /api/v2/billing/logs,DELETE /api/v2/workflows/{id}andPOST /api/v2/workflows/{id}/execute(body endpoint, auth header ahead ofContent-Type).bun run type-check,bun run lint:checkandbun run check:audits(25 audits) pass.Checklist