-
Notifications
You must be signed in to change notification settings - Fork 4k
Add heredoc support for cURL JSON body #3790
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add heredoc support for cURL JSON body #3790
Conversation
🦋 Changeset detectedLatest commit: 10a9b3d The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
5c55214 to
cbebf1a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds heredoc support for cURL code samples when JSON bodies contain single quotes, preventing shell escaping issues. The changes refactor the cURL generator to use a new buildHeredoc utility function that handles both regular command-line continuation and heredoc formatting.
- Introduces heredoc syntax (
--data @- <<'EOF') for JSON bodies containing single quotes - Refactors cURL line joining logic into a reusable
buildHeredocfunction - Maintains backward compatibility for JSON bodies without single quotes
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/react-openapi/src/code-samples.ts | Adds buildHeredoc function and updates JSON body generation to use heredoc when single quotes are present |
| .changeset/big-jeans-press.md | Documents the patch change for heredoc support |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
cbebf1a to
10a9b3d
Compare
…e-option * main: (48 commits) Edgeless Assistant window on `depth: flat` sites (#3788) Add heredoc support for cURL JSON body (#3790) Update site layout and blocks with container queries (#3780) Rework OpenAPI Authorizations + scopes (#3786) Support custom cover heights (#3779) Update `DropdownMenu` styling (#3787) Treat pages without visible TOC items as `no-toc` (#3783) Implement unique title tags for sections & variants (#3768) Add page breadcrumbs to search results (#3784) Expand code block when printing (#3782) Disable Workers Observability (#3781) Reword "Everywhere" search scope to "All docs" (#3776) Add padding to TOC page group items (#3777) Improve OAuth2 scopes handling in OpenAPI (#3775) Support translations and generic variants together (#3772) Initialize hash on mount and improve navigation handling (#3774) Revert "Support cover image heights and positioning changes" (#3771) Fix search container shadow (#3770) Redirect to space base path on fallback true (#3745) Add isRoot prop to PagesList for root header offset (#3759) ...
No description provided.