-
Notifications
You must be signed in to change notification settings - Fork 762
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
fix(execute): empty field added to multi-value parameters #3367
Conversation
Let me know if the same changes should also be made for |
Please add a test as well for the cases we're trying to fix with this change. |
We need to know for sure, why this happens.
I think it will be related to the result of analysis related to the previous quote |
The Line 331 in e0c96b0
[ 'fields', [] ] .
In case of OAS2, we will go in here Line 296 in e0c96b0
[ 'fields', '' ] .
Because of this, the string that we get to add to the base URL in Line 419 in e0c96b0
fields= .
Perhaps we could change this check here Line 297 in e0c96b0
if (collectionFormat === 'multi' || value.length === 0) to get an empty array for OAS2 as well? Otherwise we can stay with if (value && !(Array.isArray(value) && value.length === 0)) in query parameter builder.
|
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.
LGTM. Nicely done!
## [3.25.1](v3.25.0...v3.25.1) (2024-02-12) ### Bug Fixes * **execute:** detect empty value for multi-value parameters ([#3367](#3367)) ([500dc17](500dc17))
🎉 This PR is included in version 3.25.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Refs swagger-api/swagger-ui#5176
Fixes the issue for when no value is selected, sending an empty string in an array after selecting the '--' option is a separate issue in Swagger UI.