Skip to content

[Browser Run][/json endpoint] Fix failing curl examples#31834

Merged
kathayl merged 2 commits into
cloudflare:productionfrom
blackmountainb:blackmountainb/json-br
Jul 1, 2026
Merged

[Browser Run][/json endpoint] Fix failing curl examples#31834
kathayl merged 2 commits into
cloudflare:productionfrom
blackmountainb:blackmountainb/json-br

Conversation

@blackmountainb

Copy link
Copy Markdown
Contributor

Summary

Fixes broken curl examples on the /json endpoint page and aligns the request payload shape with what the API actually accepts, so users can copy-paste the snippets and have them run successfully.
Changes:

  • Fixed invalid response_format field name.
  • Fixed the "With only a JSON schema" curl example. The -d payload was not valid JSON — it opened with a bare "response_format": key and no wrapping {}, and was missing the required url field. Rewrote it as a complete, runnable request body.
  • Fixed the missing closing quote in the "Using a custom model (BYO API Key)" curl example (} → }'), which previously caused the shell to hang waiting for input.
  • Fixed the "With only a prompt" sample response. The json output block was missing its opening {.
  • Standardized curl syntax across all examples to match other quick-action pages: short flags (-X, -H, -d) instead of long flags (--request, --header, --data), and / placeholders instead of CF_ACCOUNT_ID / CF_API_TOKEN.

Screenshots (optional)

N/A — text-only changes to code samples.

Documentation checklist

@cloudflare-docs-bot

cloudflare-docs-bot Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Review

⚠️ 1 warning found in commit 3e69efb.

Code Review

This code review is in beta and may not always be helpful — use your judgment.

No code review issues found.

Conventions

Checks PR title, description, and redirect checklist.

Warnings (1)
File Issue
PR Product or area identified — The title "Fix failing curl examples and match parameters with other quick actio…" does not identify the product, feature, or content area the docs change affects. Fix: Add the affected area to the title, e.g. prefix with a product tag like [Workers AI] or mention the JSON endpoint quick-action page.

Style Guide Review

No style-guide issues found.

Redirects

No missing redirect entries found.

Commands

Only codeowners can run commands. Post a comment with the command to trigger it.

Command Description
/review Runs a review now. Incremental if a prior review exists, full if not.
/full-review Re-reviews the entire PR diff from scratch, ignoring incremental history. Useful after a rebase, when you want a fresh review, or if the bot gets out of sync and reports issues that no longer exist.
/ignore-review-limit Permanently lifts the 2-review automatic limit for this PR. Future pushes will trigger reviews as normal.
/disable-auto-review Stops automatic reviews from triggering on future pushes to this PR. Codeowners can still run /review or /full-review manually.

@kathayl

kathayl commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

/bonk fix both issues found in the review

@ask-bonk

ask-bonk Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Author identity unknown

*** Please tell me who you are.

Run

git config --global user.email "you@example.com"
git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: empty ident name (for runner@runnervmkkn4f.ncyrd55v203ulhxzivhbvl0w2f.yx.internal.cloudapp.net) not allowed

github run

@ask-bonk

ask-bonk Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

@kathayl Bonk workflow failed. Check the logs for details.

View workflow run · To retry, trigger Bonk again.

@blackmountainb blackmountainb changed the title Fix failing curl examples and match parameters with other quick actio… [Browser Run][/json endpoint] Fix failing curl examples Jul 1, 2026
@kathayl kathayl merged commit e1b3707 into cloudflare:production Jul 1, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants