@SpringQueryMap doesn't support Map<String, String[]>
See original GitHub issueDescribe the bug @SpringQueryMap doesn’t support Map<String, String[]>
Sample
@FeignClient(name = "postman-echo", url = "https://postman-echo.com")
public interface PostmanEchoClient {
@GetMapping(path = "/get")
Object get(@SpringQueryMap Map<String, String[]> paramMap);
}
Test
Map<String, String[]> paramMap = new HashMap<>(2);
paramMap.put("a", new String[] {"a1", "a2"});
paramMap.put("b", new String[] {"b1", "b2"});
postmanEchoClient.get(paramMap);
Generated url: https://postman-echo.com/get?a=%5BLjava.lang.String%3B%405ed08faf&b=%5BLjava.lang.String%3B%4075386aa2
Expected url: https://postman-echo.com/get?a=a1&a=a2&b=b1&b=b2
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Spring Cloud OpenFeign Failed to Create Dynamic Query ...
I tried using @QueryMap instead of @RequestParam but @QueryMap does not generate query parameters. Btw @RequestParam Map<String, Object> params ...
Read more >Spring Cloud OpenFeign
In the @FeignClient annotation the String value ("stores" above) is an arbitrary client name, which is used to create a Spring Cloud LoadBalancer...
Read more >Introduction to Spring Cloud OpenFeign - Baeldung
In this tutorial, we're going to describe Spring Cloud OpenFeign — a declarative REST client for Spring Boot apps.
Read more >Retrofit 2 — Add Multiple Query Parameter With QueryMap
Adding request parameters can be kind of pain in the a** if your service ... annotation expects a Map with key-value-pairs of type...
Read more >Java – Feign Client does not resolve Query parameter – iTecNote
The OpenFeign @QueryMap annotation provides support for POJOs to be used as GET parameter maps. Spring Cloud OpenFeign provides an equivalent @SpringQueryMap ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@linianhui, here is my example. You can see the result what you want in log when you use List instead of array.
link - https://github.com/Junhyunny/openfeign-test test - curl localhost:8080/testList
@spencergibb I found out other problem in my example. RequestParam is {a=a1, b=b1}. I expect RequestParam {a=[a1, a2], b=[b1,b2]}. What do you think of this? Is it bug?
Closing in favor of https://github.com/OpenFeign/feign/issues/1170