Skip to content

Conversation

andreaangiolillo
Copy link
Collaborator

@andreaangiolillo andreaangiolillo commented Jun 3, 2025

Proposed changes

Jira ticket: CLOUDP-321939

Description

Bug

Doc team feedback: cURL commands for PUT, PATCH, and POST methods are not valid. Users receive errors if copying and pasting into terminal and replacing variables with their own data. Each command that uses these methods and requires a request body needs an extra \ after the endpoint URI in order for shells to handle the line break.

Fix

This PR adds an additional \ and update the payload from { <Payload> } to '{ <Payload> }' for PUT, PATCH, and POST.

You can check how this change renders in https://redocly.github.io/redoc/#tag/Projects/operation/createProject. Example:

curl --user "{PUBLIC-KEY}:{PRIVATE-KEY}" \
  --digest \
  --header "Accept: application/vnd.atlas.2025-01-01+json" \
  --header "Content-Type: application/vnd.atlas.2025-01-01+json" \
  -X POST "https://cloud.mongodb.com/api/atlas/v2/groups" \
  -d '{ <Payload> }'

Comment on lines +69 to +70
source += "-X " + opMethod + " \"https://cloud.mongodb.com" + pathName + "\" \\\n "
source += "-d " + "'{ <Payload> }'"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

main change. The other files were regenerated for the e2e tests.

@andreaangiolillo andreaangiolillo marked this pull request as ready for review June 3, 2025 10:58
@andreaangiolillo andreaangiolillo requested a review from a team as a code owner June 3, 2025 10:58
@andreaangiolillo andreaangiolillo merged commit b689725 into main Jun 3, 2025
10 checks passed
@andreaangiolillo andreaangiolillo deleted the CLOUDP-321939 branch June 3, 2025 11:10
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.

2 participants