feign
feign copied to clipboard
Why not support multiple @QueryMap at the same time
I have an API that looks something like this :
@GetMapping("demo")
public String demo(PageParam pageParam, Query query){
return "success";
}
I wish I could call this in feign Client:
public interface DemoFeignClient {
@GetMapping("demo")
String demo(@QueryMap PageParam pageParam, @QueryMap Query query);
}
But feign only passes the attributes of the first object.
Why not support simultaneous use @QueryMap ?
queryMapIndex paramter is only one
queryMapIndex paramter is only one
Sorry, what I asked was why it was designed this way. At present, I have achieved multiple @QueryMap support by overriding Feign.class.
I think it will confuse encoders if multiple @QueryMap
annotations are allowed:
public interface TestFeignClient {
@GetMapping("test")
String test(@QueryMap A a, @QueryMap B b, @QueryMap C c);
}
class A {
String name;
}
class B {
String name; // duplicate
}
class C <T> {
T name; // may be not string
}
Not sure which name should be used
I think it will confuse encoders if multiple
@QueryMap
annotations are allowed:public interface TestFeignClient { @GetMapping("test") String test(@QueryMap A a, @QueryMap B b, @QueryMap C c); } class A { String name; } class B { String name; // duplicate } class C <T> { T name; // may be not string }
Not sure which name should be used
I think encoding this kind of scenario directly should pose no issues, and the resulting QueryString would also be normal.