Skip to content

Add cURL examples to API reference markdown exports. - #1532

Open
scottjstrand1 wants to merge 1 commit into
mainfrom
api-reference-markdown-curl-examples
Open

Add cURL examples to API reference markdown exports.#1532
scottjstrand1 wants to merge 1 commit into
mainfrom
api-reference-markdown-curl-examples

Conversation

@scottjstrand1

Copy link
Copy Markdown
Contributor

Generated API reference .md files now include executable cURL examples for each endpoint, matching the interactive API reference UI.

Generated API reference .md files now include executable cURL examples for each endpoint, matching the interactive API reference UI.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel

vercel Bot commented Jul 10, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Jul 10, 2026 6:14pm

Request Review

@cursor cursor 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.

Risk HIGH: Adds cURL request examples to API reference markdown exports by extracting a reusable generateCurlRequestExample helper from components/ui/ApiReference/helpers.ts and consuming it in scripts/generateApiMarkdown.ts.

Reasons

  • components/ui/ApiReference/helpers.ts is a .ts file inside components/, which triggers the HIGH risk rule for code file modifications outside of content.
  • The modified helper is a shared/reusable utility — the new generateCurlRequestExample function is exported and consumed by both the component layer and the build script, so a bug here could affect both the interactive API reference UI and the generated markdown files.
  • The refactor changes the output format of the existing augmentSnippetsWithCurlRequest function (removes leading whitespace/indentation from the curl template), which could subtly change how cURL snippets render in the interactive API reference.
  • The author (scottjstrand1) is not in the repository's known contributor list, so this PR should receive a thorough review.
  • Two files changed with 60 additions and 14 deletions — a modest diff size, but the structural impact on shared code warrants careful review.

Notes

  • Verify that the refactored augmentSnippetsWithCurlRequest output (which no longer has leading indentation) renders identically in the interactive API reference UI. The old template used indented multiline strings; the new generateCurlRequestExample function produces flush-left output.
  • Confirm that JSON.stringify(body) in the -d flag produces valid shell-safe strings — request bodies containing single quotes would break the generated cURL command.
  • Check that stainlessSpec.environments.production resolves to the correct base URL and doesn't leak internal/staging URLs into the exported markdown.
  • Review the requestExample fallback chain (requestBodyContent?.example || requestBody?.example) to ensure it picks up examples consistently across all endpoints.
Open in Web View Automation 

Sent by Cursor Automation: Docs PR classifier

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e153a5c. Configure here.

maybeBodyString,
]
.filter(Boolean)
.join("\n");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Trailing backslash breaks curl examples

Medium Severity

generateCurlRequestExample always appends a line-continuation \ on the Authorization header, then drops an empty body line via .filter(Boolean). For endpoints without a request body example, the generated command ends with \, so pasted "executable" cURL examples hang in the shell instead of running.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit e153a5c. Configure here.

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