feign
feign copied to clipboard
Spring Cloud Feign Client @RequestParam with List parameter creates a wrong request
@CollectionFormat(feign.CollectionFormat.CSV)
[...]
@RequestMapping(method = RequestMethod.GET, value = "/search/findByIdIn")
Resources<MyClass> get(@RequestParam("ids") List<Long> ids);
creates a request like: /search/findByIdIn?ids=1,2,3
... however, feign.CollectionFormat
does not support custom separation characters, I want to perform a request with values separated by ;
, like /search/findByIdIn?ids=1;2;3
.
How can I achieve this?
Since you are using Spring, I'm not sure if you can take use the Level 3 expansion features we provide natively: https://github.com/OpenFeign/feign#request-parameter-expansion, but you can try it.
If that doesn't work for you, you'll need to create a custom Expander
to generate the results you need. https://github.com/OpenFeign/feign#custom-expansion