title: Spring Boot Feign requestParam containing an array
body: <p>I'm trying to query the <a href="https://transport.opendata.ch/" rel="nofollow noreferrer">https://transport.opendata.ch/</a> API. In this API, it is possible to filter the response to avoid a big payload (using <code>?fields[]=...</code>). </p>
  
  <p>For example : <a href="http://transport.opendata.ch/v1/connections?from=Lausanne&amp;to=Zurich&amp;fields[]=connections/from&amp;fields[]=connections/to" rel="nofollow noreferrer">http://transport.opendata.ch/v1/connections?from=Lausanne&amp;to=Zurich&amp;fields[]=connections/from&amp;fields[]=connections/to</a></p>
  
  <p>I'm using Spring Boot and Feign, here is my code :</p>
  
  <pre><code>@FeignClient(value = "transport", url = "${transport.url}")
  public interface TransportClient {
  
      @RequestMapping(method = GET, value = "/connections", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
      Connections getConnections(@RequestParam("from") String from, @RequestParam("to") String to, @RequestParam("fields[]") String[] fields);
  
      default Connections getConnections(String from, String to) {
          return getConnections(from, to, new String[] {"connections/from", "connections/to"});
      }
  }
  </code></pre>
  
  <p>The trouble is the generated request : </p>
  
  <p><a href="http://transport.opendata.ch/v1/connections?from=Lausanne&amp;to=Zurich&amp;fields%5B%5D=connections%2Ffrom%2Cconnections%2Fto" rel="nofollow noreferrer">http://transport.opendata.ch/v1/connections?from=Lausanne&amp;to=Zurich&amp;fields%5B%5D=connections%2Ffrom%2Cconnections%2Fto</a></p>
  
  <p>As you can see, the url is encoded and the array is not correctly binded (using comma instead of several <code>fields</code> in the url).</p>
  
  <p>Is there any way to achieve this? If it cannot be done with FeignClient (Spring), maybe with Feign it is possible ?</p>
  
  <p>Thanks for your help.</p>