We run into an issue when updating from 4.0.1 to 4.2.0. We relied on a custom IUrlParameterFormatter to serialize IEnumerable into comma separated values. After updating to 4.2.0 we started having issues with query string parameters and it looks like IEnumerable is being serialized with BuildQueryMap probably because of the DoNotConvertToQueryMap being incorrect in this scenario.
Here is an example of our interface:
private interface ISomeApi
{
[Get("/companies")]
Task GetCompanies(IEnumerable<Guid> ids);
}
When calling apiClient.GetCompanies(new[] {Guid.NewGuid(), Guid.NewGuid()}) we get a query string like
?Length=2&LongLength=2&Rank=1&SyncRoot=de802b69-a204-4df4-b5e0-7d658777d056&SyncRoot=547f8167-1e48-4204-8081-c132c13c558a&IsReadOnly=False&IsFixedSize=True&IsSynchronized=False
@eduardocampano I have a fix for this, but it'll only do part of what you want -- it'll do the commas, but the commas will be urlencoded, so the result looks like this:
numbers=1%2C2%2C3 where the input was an enumerable array of 1, 2, 3. The server should be decoding the urls, would this work for you?
Wow, that was fast, I guess it's the way it's working in 4.0.1, will check
@eduardocampano there were a couple of UrlEncoding fixes in 4.2 as well, so it may not be 100% the same.
@eduardocampano if you can confirm this works for you, I can merge it in. Thanks.
@onovotny confirmed it works, thanks for the quick fix
Will try to get a 4.2.1 to nuget soon.