Skip to content

Commit ce49d6f

Browse files
authored
Merge pull request #500 from zarebski-m/master
use MethodParameter#isOptional() instead of checking for Optional type
2 parents 1fc8879 + 703b7c8 commit ce49d6f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

springdoc-openapi-common/src/main/java/org/springdoc/core/AbstractRequestBuilder.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,7 @@ private Parameter buildParams(ParameterInfo parameterInfo, Components components
279279

280280
}
281281
else if (requestParam != null && !parameterBuilder.isFile(parameterInfo.getParameter())) {
282-
boolean isOptional = Optional.class.equals(methodParameter.getParameterType());
283-
requestInfo = new RequestInfo(ParameterIn.QUERY.toString(), requestParam.value(), requestParam.required() && !isOptional,
282+
requestInfo = new RequestInfo(ParameterIn.QUERY.toString(), requestParam.value(), requestParam.required() && !methodParameter.isOptional(),
284283
requestParam.defaultValue());
285284
parameter = buildParam(parameterInfo, components, requestInfo, jsonView);
286285
}

0 commit comments

Comments
 (0)