tmenier / Flurl

Fluent URL builder and testable HTTP client for .NET
https://flurl.dev
MIT License
4.23k stars 387 forks source link

Handle empty lists in SetQueryParams #798

Closed gballigand closed 10 months ago

gballigand commented 10 months ago

I made some changes in order to handles empty lists in Query Params.

I had an issue before in my code because it was handling null and empty lists the same way. Therefore, my code set an empty list query parameter for instantiated but empty list and no query param for list which are null.

tmenier commented 10 months ago

Sorry, but I don't agree with the change. Currently if I append a query param named "x" whose value is a list of 3 items, 3 params will be added, each named "x". If it's list with no items, no params will be added. To me that's consistent. I think you'll need to account for it a different way in your code.

As a side note, have a look the contribution guidelines. I established them so people don't spend time coding something that I might not agree with conceptually.