Skip to content

Commit

Permalink
micronaut-projects#144 - Use the value of the UriMapping annotation o…
Browse files Browse the repository at this point in the history
…n the element's declaring type instead of Controller.
  • Loading branch information
Mikael Vik committed Feb 17, 2020
1 parent 931e767 commit 0276b45
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import io.micronaut.http.annotation.PathVariable;
import io.micronaut.http.annotation.Produces;
import io.micronaut.http.annotation.QueryValue;
import io.micronaut.http.annotation.UriMapping;
import io.micronaut.http.uri.UriMatchTemplate;
import io.micronaut.http.uri.UriMatchVariable;
import io.micronaut.inject.ast.ClassElement;
Expand Down Expand Up @@ -139,7 +140,7 @@ public void visitMethod(MethodElement element, VisitorContext context) {
return;
}

String controllerValue = element.getValue(Controller.class, String.class).orElse("/");
String controllerValue = element.getDeclaringType().getValue(UriMapping.class, String.class).orElse("/");
controllerValue = getPropertyPlaceholderResolver().resolvePlaceholders(controllerValue).orElse(controllerValue);
UriMatchTemplate matchTemplate = UriMatchTemplate.of(controllerValue);
String methodValue = element.getValue(HttpMethodMapping.class, String.class).orElse("/");
Expand Down

0 comments on commit 0276b45

Please sign in to comment.