I'm trying to migrate an old project to Retrofit library and this project has quite tricky API. So I have a query template like this:
@GET(value = "products/search")
Single<ProductSearchResponse> productSearch();
And I have to add some parameters here of following template:
filter[attributeId]=attributeValueId
For example:
products/search?filter[1]=10&filter[1]=11&filter[2]=20&filter[2]=21
That's how API works and I can't change it. I know that we can pass a list as a parameter, like this:
@Query("filter") List<Integer> attributeValueIds
But how can I also set parameter's name dynamically?