Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mvc Parameter annotations are not inherited [SPR-14526] #19095

Closed
spring-projects-issues opened this issue Jul 29, 2016 · 0 comments
Closed

mvc Parameter annotations are not inherited [SPR-14526] #19095

spring-projects-issues opened this issue Jul 29, 2016 · 0 comments
Assignees
Labels
status: duplicate A duplicate of another issue

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Jul 29, 2016

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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

2 participants