-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Closed
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancementA general enhancement
Milestone
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
Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancementA general enhancement