Difference between @SpringQueryMap(package org.springframework.cloud.openfeign;) and @QueryMap(package feign) in FeignClient.
For Example, I can use @SpringQueryMap with Pageable in FeignClient method, but I cant use @QueryMap
@PostMapping("/user/getUserList")
ResponseEntity<Page<UserDto>> getUserList(@RequestBody UserSearchDto searchInputDto, @SpringQueryMap Pageable page);
As it is stated in the Spring documentation, difference between @QueryMap and @SpringQueryMap is that:
the default OpenFeign QueryMap annotation is incompatible with Spring because it lacks a value property.
Spring Cloud documentation. Feign part
So instead of @QueryMap, in Spring Feign Client @SpringQueryMap should be used to annotate a POJO or Map parameter as a query parameter map.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With