Closed
Description
Terence Mill opened SPR-14526 and commented
@RequestMapping(method = RequestMethod.GET, value = "/{userId}", produces = "application/json", consumes = "application/json")
public IUser getUserById(@PathVariable("userId") Long userId);
Calling @Get
on PROT
://DOMAIN
/users/1 -> userId is NULL :(
@RequestMapping("/users") public interface IUserEndpoint {..}
@RestController public class UserEndpoint extends implements IUserEndpoint {..}
(!) It only works if i repeat @PathVariable
in my implementing @RestController
@RestController public class UserEndpoint extends implements IUserEndpoint {
public IUser getUserById(@PathVariable("userId") Long userId);
Repeating the REST contract is an ugly workaround
Affects: 4.2.6
Issue Links:
- Enable REST controller method parameter annotations on an interface [SPR-11055] #15682 Enable REST controller method parameter annotations on an interface ("duplicates")