Skip to content

Commit 082f3bd

Browse files
committed
specified roles override controller level
1 parent 4b06090 commit 082f3bd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

http-generator-core/src/main/java/io/avaje/http/generator/core/MethodReader.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,9 @@ public void buildApiDocumentation() {
338338

339339
public List<String> roles() {
340340
final var roles = new ArrayList<>(methodRoles);
341-
roles.addAll(bean.roles());
341+
if (roles.isEmpty()) {
342+
roles.addAll(bean.roles());
343+
}
342344
return roles;
343345
}
344346

@@ -521,7 +523,7 @@ private List<PathSegments.Segment> namedSegments() {
521523

522524
private boolean allArgParamNames() {
523525
for (int i = 0; i < params.size(); i++) {
524-
if (!params.get(i).name().equals("arg" + i)) {
526+
if (!("arg" + i).equals(params.get(i).name())) {
525527
return false;
526528
}
527529
}

0 commit comments

Comments
 (0)