Multiple query parameter empty arrays append orphaned ampersands to query string #1934
Replies: 1 comment
-
Thanks for filing! This is an issue for sure. Migrated here, and would love a PR if anyone is able: #1935 Should be a simple matter of adding a test first, then getting that test to pass. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I've been using
openapi-fetch
and have been enjoying it so far but I have noticed a strange behaviour with arrays being passed in query paramshere's a basic implementation of a client that will call the
/posts
endpoint and pass in four separate query params, each an empty array just to be a bit dramatic:Given all these arrays are empty, I wouldn't expect them to impact the query params; similar to how

undefined
ornull
would behave. However, the resulting request URL ishttp://localhost:3001/posts?&&&
I assume this behaviour isn't intended but wanted to check before raising an issue. I'm also willing to contribute to help solve this if I can. Thanks.
Beta Was this translation helpful? Give feedback.
All reactions