Search code examples
javaspringspring-cloudnetflix-feign

Spring Cloud Feign Client duplicate list values


I have this interface mapping my rest client using Spring cloud Feign.

@FeignClient(url = "http://localhost:8080")
public interface RestClient {

    @RequestMapping(value = "?ids={ids}", method = GET)
    List<Posicao> get(@RequestParam(value = "ids") List ids);
}

I have a list in my parameters, calling the client I have this request:

restClient.get(Arrays.asList(1, 2));

http://localhost:8080/ids=1,2,1,2

It's duplicating the list values!

I already tried using an array, an integer and string generic list, but no success.


Solution

  • Remove ?ids={ids} from @RequestMapping fixes the problem. Only path parameters need to go there.