I have one FeignClient class and I want to use MatrixVariable to pass parameters like below
@FeignClient(value = "apiService", url = "${api.url}", configuration =ApiServiceConfiguration.class)
public interface ApiServiceFeign {
@RequestMapping(value = "/students{matrixParam}", method = RequestMethod.GET)
StudentList getStudents(@MatrixVariable("matrixParam") Map<String,List<String>>);
}
but when I use above code it doesn't work. Feign Client can not understand the MatrixVariable. Is there any way to make this call?
Currently, I have found the temporary solution using PathVariable like below
@FeignClient(value = "apiService", url = "${api.url}", configuration =ApiServiceConfiguration.class)
public interface ApiServiceFeign {
@RequestMapping(value = "/students;name={name};accountId={accountId}", method = RequestMethod.GET)
StudentList getStudents(@PathVariable("name") String name,@PathVariable("accountId") Long accountId);
}
I really appreciate if any one give better solution using MatrixVariable in Feignclient