Prevent duplicate controller registrations through class-level @RequestMapping.
When we detected @BasePathAwareController and @RepositoryRestController instances, we now reject types that use @RequestMapping on the class level as doing so causes an inevitable registration of the controller with Spring MVC. Fixes #1342, #1628, #1686, #1946.
This commit is contained in:
@@ -59,10 +59,9 @@ public class JpaRepositoryConfig extends JpaInfrastructureConfig {
|
||||
}
|
||||
|
||||
@RepositoryRestController
|
||||
@RequestMapping("orders")
|
||||
static class OrdersJsonController {
|
||||
|
||||
@RequestMapping(value = "/search/sort", method = RequestMethod.POST, produces = "application/hal+json")
|
||||
@RequestMapping(value = "/orders/search/sort", method = RequestMethod.POST, produces = "application/hal+json")
|
||||
void someMethodWithArgs(Sort sort, Pageable pageable, DefaultedPageable defaultedPageable) {}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user