Skip to content
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

Request body can't be unset #145

Closed
bourdakos1 opened this issue Jan 3, 2022 · 0 comments · Fixed by #147
Closed

Request body can't be unset #145

bourdakos1 opened this issue Jan 3, 2022 · 0 comments · Fixed by #147
Labels
bug Something isn't working feature This is not a bug or issue. It is a request for a new feature package: theme-openapi

Comments

@bourdakos1
Copy link
Member

bourdakos1 commented Jan 3, 2022

Endpoints with a request body (optional or required) always have an example body prefilled. If this example is deleted, the body is still used in the request/sample code as an empty string.

cURL example on page load:

curl -L -X POST '/v2/store/subscribe' \
--data-raw '{
  "callbackUrl": "https://myserver.com/send/callback/here",
  "eventName": "orderInProgress"
}'

cURL example after deleting code prefilled in editor:

curl -L -X POST '/v2/store/subscribe' \
--data-raw ''

Expected:

curl -L -X POST '/v2/store/subscribe'

Additional feature request:
Since we always provide an example body by default (even when body is optional), it might make sense to remove the + Show optional body and just always show the editor (regardless of optional/required). I believe this would reduce some user confusion of where the body came from on requests where the body was optional.

@simranbentel I think this feature would also fix your issue in #91. Let me know your thoughts 😊

@bourdakos1 bourdakos1 added bug Something isn't working feature This is not a bug or issue. It is a request for a new feature package: theme-openapi labels Jan 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature This is not a bug or issue. It is a request for a new feature package: theme-openapi
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant