Skip to content

Commit

Permalink
request parameters using 'Optional' shouldn't honor 'required()'; fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
stoicflame committed Mar 9, 2021
1 parent ad3240d commit 76c0631
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@ public SimpleRequestParameter(Element declaration, PathContext context, Resource
}

DecoratedTypeMirror parameterType = loadType();
if (parameterType.isInstanceOf("java.util.Optional")) {
required = false;
}

this.multivalued = parameterType.isArray() || parameterType.isCollection() || parameterType.isStream();

this.parameterName = parameterName;
Expand Down

0 comments on commit 76c0631

Please sign in to comment.