Closed
Description
Paul opened SPR-14021 and commented
If I have Spring MVC interface with methods, whose params are annotated with different param types like this:
public interface PersonAPIEndpoint {
@RequestMapping(
path = "/person/{username}/",
method = RequestMethod.GET
)
DeferredResult<PersonWithOrganizationalUnitsDTO> loadUserByUsername(@PathVariable("username") String username);
@RequestMapping(
path = "/person",
method = RequestMethod.GET
)
DeferredResult<DataPage<PersonDTO>> listPersons(@RequestParam("pageNum") int pageNum, @RequestParam("pageSize") int pageSize, @RequestParam(value = "query", required = false) String query);
and class, which is derived from this interface, but arguments of methods are not annotated with Param annotations mapper behaviour is inconsistent:
values, annotated with @RequestParam
get their values in implementing class, and with @PathVariable
— not.
Issue Links:
- Enable REST controller method parameter annotations on an interface [SPR-11055] #15682 Enable REST controller method parameter annotations on an interface ("duplicates")
Referenced from: commits spring-attic/spring-framework-issues@bfbb943, spring-attic/spring-framework-issues@de6f178