@QueryMap does not work with POJOs when used after @Param
See original GitHub issueThis kind of code (from https://github.com/OpenFeign/feign/pull/335/files#diff-13815c678552a275075ab18b17c67784R616):
@RequestLine("GET /?name={name}")
void queryMapWithQueryParams(@Param("name") String name, @QueryMap Map<String, Object> queryMap);
Does not work when @QueryMap
is used on a POJO.
In my case, I was trying to use Spring’s Pageable
like so:
@RequestLine("GET /things?x={x}&y={y}&z={z}")
CustomPageImpl<ThingDto> getElements(
@Param("x") ZonedDateTime x,
@Param("y") String y,
@Param("z") String z,
@QueryMap Pageable pageable);
By the way… Is there any simpler way to declare query parameters without having to refer four times to their names?
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Feign Client does not resolve Query parameter - Stack Overflow
The OpenFeign @QueryMap annotation provides support for POJOs to be used as GET parameter maps. Spring Cloud OpenFeign provides an equivalent @ ...
Read more >1. Declarative REST Client: Feign - Spring Cloud OpenFeign
The OpenFeign @QueryMap annotation provides support for POJOs to be used as GET parameter maps. Unfortunately, the default OpenFeign QueryMap annotation is ......
Read more >QueryMap (Feign Core 10.9.1 API) - javadoc.io
A template parameter that can be applied to a Map that contains query parameters, ... It is not necessary to reference the parameter...
Read more >PojoQueryBuilder (MarkLogic Java Client API 5.0.0)
It adds convenience methods specific to working with pojos and does not ... If you use PojoRepository to persist your products, you can...
Read more >feign.RequestTemplate.queries java code examples - Tabnine
How to use. queries ... forEach(param -> parameters.add(param, "{" + param + "}")); } if ... queryMapIndex() == null, "Query map can only...
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
Time is a friend here. I’ll revisit this.
Just ran into this, IMO it should be clear in the documentation or even better, the
Contract
should throw an exception when it encounters such a case.