-
Notifications
You must be signed in to change notification settings - Fork 9k
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
Allow to skip submitting empty values in form data #5830
Allow to skip submitting empty values in form data #5830
Conversation
please build |
is it possible to use this functionality in rswag? if so, tell me how to do this? |
I think the new swagger-ui will allow you to use this feature with the non-required parameters of the requestBody. |
@abcang, sorry, but I don’t understand what I’m doing wrong
but still no checkboxes... |
Hmmm... this feature came in from version 3.26.0, is that the right version? |
Hi, I do not get it to work... is there something missing?
here too no checkboxes... |
I have confirmed that a checkbox is displayed in
(The URL of the petstore definition in the pull request description was broken, so I replaced it with a valid link.) |
Thanks, works great. I forgot to update the swagger-editor. |
Sorry, this pull request doesn't implement the ability to change the default behavior. |
…ata (swagger-api#5830)" This reverts commit 1b6cb7d.
I am looking for something similar but for arrays. How to skip submitting empty arrays for a query parameter? I'am using Swagger Module for NestJS. |
Description
Adds an option to send an empty value when submitting values in form data. This only works for OpenAPI 3 if the content type starts with
multipart/
or isapplication/x-www-form-urlencoded
.Motivation and Context
Fixes #5303
Two implementations were suggested, but I chose the way to add the options.
Since it is not possible to explicitly send an empty string when automatically skipping empty values, I thought an implementation that could choose whether or not to send an empty string would be better. (Skip empty values by default.)
How Has This Been Tested?
Using OpenAPI 3 petstore definition, I checked if
POST /pet/{petId}
skips empty values.Screenshots (if appropriate):
Checklist
My PR contains...
src/
is unmodified: changes to documentation, CI, metadata, etc.)package.json
)My changes...
Documentation
Automated tests