Skip to content

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

Closed

Description

@spring-projects-issues

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:

Activity

  1. added
    type: enhancement
    status: duplicate
    in: web
    on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: webstatus: duplicatetype: enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions