BFergerson commented on a change in pull request #5085:
URL: https://github.com/apache/skywalking/pull/5085#discussion_r471565413
##########
File path:
apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-commons/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/commons/interceptor/RestMappingMethodInterceptor.java
##########
@@ -80,6 +80,20 @@ public String getRequestURL(Method method) {
@Override
public String getAcceptedMethodTypes(Method method) {
- return "";
+ return ParsePathUtil.recursiveParseMethodAnnotation(method, m -> {
+ if (AnnotationUtils.getAnnotation(m, GetMapping.class) != null) {
+ return "{GET}";
+ } else if (AnnotationUtils.getAnnotation(m, PostMapping.class) !=
null) {
+ return "{POST}";
+ } else if (AnnotationUtils.getAnnotation(m, PutMapping.class) !=
null) {
+ return "{PUT}";
+ } else if (AnnotationUtils.getAnnotation(m, DeleteMapping.class)
!= null) {
+ return "{DELETE}";
+ } else if (AnnotationUtils.getAnnotation(m, PatchMapping.class) !=
null) {
+ return "{PATCH}";
+ } else {
+ return null;
Review comment:
I'm sure it'll always end up being `""` but returning `null` allows
https://github.com/apache/skywalking/blob/b173cde5dbeeb1a15aa25954fe960dd480267f20/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-commons/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/commons/ParsePathUtil.java#L34
to execute.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]