Multiple query parameter empty arrays append orphaned ampersands to query string #1935
Labels
bug
Something isn't working
good first issue
Straightforward problem, solvable for first-time contributors without deep knowledge of the project
openapi-fetch
Relevant to the openapi-fetch library
PRs welcome
PRs are welcome to solve this issue!
Discussed in #1934
Originally posted by BlakeSzabo October 1, 2024
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.
The text was updated successfully, but these errors were encountered: