Describe the bug
Refit intarface:
[Get("/queues/{id}/export")]
Task<string> GetQueueAsync([Header("Authorization")] string authorization,
[AliasAs("id")] long id,
[AliasAs("format")] string format,
[AliasAs("page")] int page,
[AliasAs("status")] [Query(CollectionFormat.Csv)] IEnumerable<string> filters);
failt with:
`System.ArgumentException: An item with the same key has already been added. Key: 1`
` at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
at Refit.RestMethodInfo..ctor(Type targetInterface, MethodInfo methodInfo, RefitSettings refitSettings) in D:\a\1\s\Refit\RestMethodInfo.cs:line 46
at Refit.RequestBuilderImplementation.AddInterfaceHttpMethods(Type interfaceType, Dictionary`2 methods) in D:\a\1\s\Refit\RequestBuilderImplementation.cs:line 77
at Refit.RequestBuilderImplementation..ctor(Type refitInterfaceType, RefitSettings refitSettings) in D:\a\1\s\Refit\RequestBuilderImplementation.cs:line 56
at Refit.RequestBuilderFactory.Create[T](RefitSettings settings) in D:\a\1\s\Refit\RequestBuilderFactory.cs:line 18
at Refit.RestService.For[T](HttpClient client, RefitSettings settings) in D:\a\1\s\Refit\RestService.cs:line 28
at ConsoleApp1.Program.Main(String[] args)`
Steps To Reproduce
static void Main(string[] args)
{
var apiService = RestService.For<IApiService>("http://xyz.com");
var result = apiService.GetQueueAsync(1, "xml", ImportStates());
}
private static IEnumerable<string> ImportStates()
{
var states = new List<string>();
states.Add("Postponed");
states.Add("Split");
states.Add("ToReview");
return states;
}
Environment
Additional context
Same Refit interface works in 4.6.107.
Can you try the latest release please? 4.7.51 has just been published to Nuget.
can confirm that in my case it solved the problem
Excellent, glad to hear this can be closed. 馃檪
Can you try the latest release please? 4.7.51 has just been published to Nuget.
It working in my case, thank you.
Most helpful comment
can confirm that in my case it solved the problem