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

Support for interface-driven controllers linkTo(…) on path variables #1885

Open
M-Whitaker opened this issue Dec 17, 2022 · 1 comment
Open
Assignees
Labels

Comments

@M-Whitaker
Copy link

Hi, since Spring 5.1 "Controller parameter annotations get detected on interfaces as well: Allowing for complete mapping contracts in controller interfaces." I am trying to use the linkTo function on a class that implements an interface that has annotations on it for Path variables.

Unfortunately, currently, this does not resolve the actual value of the path variable and instead uses a template. Copying the annotation down to the implementing class is currently a workaround but not pretty or DRY. Is this a bug that is known?

I think #1081 documents this a little however never seems to have been looked at. I am now using spring boot 3.

Thanks

@odrotbohm
Copy link
Member

The sample code shown in the linked example don't actually show the interface not being considered, but only path variables not expanded, which, given that the reporter doesn't explain what the input to the link creation is, could be a perfectly valid outcome. Do you have a more detailed example of what you see not working? Given the general arrangement in the other ticket, the request mappings indeed are detected on interfaces.

@odrotbohm odrotbohm self-assigned this Jan 12, 2023
@odrotbohm odrotbohm changed the title Interface Driven Controllers linkTo on path variables Spring MVC Support for interface-driven controllers linkTo(…) on path variables Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants