Closed
Description
Laplie opened SPR-17340 and commented
Spring argument resolvers are listed first in
RequestMappingHandlerAdapter.getDefaultArgumentResolvers()
As a result, the built-in argument resolvers always have precedence. In a controller method such as:
@PostMapping("/foo")
public String doSomething(@MyCustomAnnotation Map<String, Object> argument)
Where "@MyCustomAnnotation
" triggers a custom argument resolver, the custom argument resolver is NEVER used because Spring has a built-in resolver for Map.class
There are 2 possible simple solutions I can think of to this problem:
- Respect the
@Order
annotation on method resolvers and sort the resolver list - Put the custom method resolvers BEFORE the builtin method resolvers.
In the meantime, the workaround that I have to use is not using a Map for my argument
Affects: 5.0.6