-
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
Optional array query params with enum are always sent after try out with non empty params #5176
Comments
Related: #4749 |
Is this PR going to be merged in the near future ? |
@mu-majid this is not a pull request, it's a bug report. |
the problem occurs when collectionFormat: "muiti" is not a problem. |
This issue forced us to modify our validation and allow an empty string (which is a sort of a hack) as a query param, it would be great if selecting "--" option would just simply not send that param instead of sending it empty. |
@h4sohail as a work around you can Ctrl+Left Click on any previously selected values to unselect them, nevertheless I agree with your suggestion:
|
Why is this still open it looks kinda straight forward what the behaviour has to be. |
has any solution been provided for this issue? ctrl+ left click on previously selected values still sends empty value. "allowEmptyValue": false is also not working. |
I have a work around for this problem when the empty field is send i alter the request to not send this empty value.
This method is ran on the requestIntercepter |
thank you for this. it works and I had to dynamically check and delete keys if they are null so with little changes I ended up with the following code:
|
Also experiencing problems with -- being an available option to select in SwaggerUI for an enum parameter that has been specifically set to not allow empty values. This issue has been running for quite a while. Any chance of a fix in the near future? It is allowing users to send invalid requests. |
Quite annoying problem. I'll be much appreciated if it can be fixed asap. |
I also have the same problem, at least we need to able to remove '--' from the list. |
It's been more than 3 years still not solved. |
So, any progress? We would also like an option to remove the |
Any progress? I'm gonna cry. Why is this option |
It's annoying when you have "--" option in list but can't remove it. It does make sense to show it in documentation if there is no need |
Bumping this so that none gets tempted to think that this is a no-issue. |
Bump |
Please fix :) |
Bump |
Please fix :) |
Please, fix ;-) |
Please fix :) |
Any update on this? |
I recently ran into this issue as well. Either of the following solutions would be great:
Currently if I select the |
Refs #9266 Refs #5176 Co-authored-by: Julien Bourges <[email protected]> Co-authored-by: Oliwia Rogala <[email protected]>
Addressed by #9511 |
Any updates? Still doesn't work. |
Hi @juske00, could you provide an example specification where this still happens? |
I am using the latest version (5.17.14), but the issue still persists. Here is an example specification to reproduce it: {
openapi: '3.1.0',
info: {
version: '1.0.0',
title: 'My API',
},
paths: {
'/api/v1/episodes/{id}': {
get: {
tags: ['episodes'],
summary: 'Get episode by ID',
parameters: [
{
schema: {
type: 'string',
example: '123456789',
},
required: true,
in: 'path',
name: 'id',
},
{
schema: {
type: 'array',
items: {
type: 'string',
enum: ['value1', 'value2'],
},
},
required: false,
description:
'Comma separated list of extra fields to include in the response',
style: 'form',
explode: false,
name: 'include',
in: 'query',
},
],
responses: {
'204': {},
},
},
},
},
} |
Q&A (please complete the following information)
Content & configuration
Example Swagger/OpenAPI definition:
Swagger-UI configuration options:
Describe the bug you're encountering
To reproduce...
Steps to reproduce the behavior:
Expected behavior
Expect 'Request URL' being:
https://editor.swagger.io/test
Screenshots
Additional context or thoughts
This issue is similar to but different from #4223. There will be no problem if array items don't have enum. The example is not required. It is there just to give a non-empty value to start with. As mentioned in the title, I do need to do a try out with some value(s) like "friends" if there is no example. In another word, it seems I couldn't clear the field after the first, non-empty, try out.
The text was updated successfully, but these errors were encountered: