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

Supports annotating parameter annotations like @PathVariable on interface method [SPR-16110] #20658

Closed
spring-projects-issues opened this issue Oct 25, 2017 · 0 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: duplicate A duplicate of another issue type: enhancement A general enhancement

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Oct 25, 2017

Yanming Zhou opened SPR-16110 and commented

public interface EchoService {
	@RequestMapping(value = "/echo/{name}", method = RequestMethod.POST)
	public String echo(@PathVariable String name);
}
@RestController
public class EchoServiceImpl implements EchoService {
	public String echo(String name) {
		return name;
	}
}

My motivation:
I need annotating @PathVariable and other parameter annotations in interface to create client proxy.

My proposal:
Improve org.springframework.core.MethodParameter to find annotation like AnnotatedElementUtils.findMergedAnnotation() which used by method level annotation like @RequestMapping. If it has side effects, improve RequestResponseBodyMethodProcessor and AbstractNamedValueMethodArgumentResolver directly.

My workaround:
Duplicate Parameter annotations on concrete controller method.


Issue Links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: duplicate A duplicate of another issue type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants