Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between @SpringQueryMap and @QueryMap

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);
like image 649
kernel Avatar asked May 05 '26 18:05

kernel


1 Answers

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.

like image 81
Markas Sislo Avatar answered May 09 '26 03:05

Markas Sislo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!