Skip to content

Commit a27e74a

Browse files
authored
Update ControllerWriter.java
1 parent 1e0e9a2 commit a27e74a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

http-generator-jex/src/main/java/io/avaje/http/generator/jex/ControllerWriter.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,10 @@ private void writeRouting(MethodReader method) {
8181

8282
private void writeClassStart() {
8383
writer.append(AT_GENERATED).eol();
84-
writer.append(diAnnotation()).eol();
85-
writer.append("@io.avaje.inject.BeanTypes({%s$Route.class, Routing.HttpService.class})", shortName).eol();
84+
writer.append(diAnnotation()).eol();
85+
if (diAnnotation().equals("@Component")) {
86+
writer.append("@io.avaje.inject.BeanTypes({%s$Route.class, Routing.HttpService.class})", shortName).eol();
87+
}
8688
writer.append("public final class %s$Route implements Routing.HttpService {", shortName).eol().eol();
8789

8890
String controllerName = "controller";

0 commit comments

Comments
 (0)