Allow resolution of optional HandlerMethod

Closes gh-35067
This commit is contained in:
rstoyanchev
2025-07-15 15:39:49 +01:00
parent 19086835a7
commit e3f1bc8422
2 changed files with 18 additions and 0 deletions
@@ -217,6 +217,10 @@ public class InvocableHandlerMethod extends HandlerMethod {
if (args[i] != null) {
continue;
}
if (parameter.getParameterType().equals(HandlerMethod.class) && parameter.isOptional()) {
args[i] = null;
continue;
}
if (!this.resolvers.supportsParameter(parameter)) {
throw new IllegalStateException(formatArgumentError(parameter, "No suitable resolver"));
}