Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
yxl1014 committed Jun 12, 2023
1 parent b4a414e commit 5c163de
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ private Object[] resolveParams(HttpContext context) throws ControllerParamsNotMa
RequestParam reqParam = (RequestParam) params[i].annotation;
value = context.getHttpParams().get(reqParam.value());
// only if required is fase
if (value == null && !reqParam.required())
if ((value == null || value.isEmpty()) && !reqParam.required())
required = false;
break;
case REQUEST_BODY:
Expand All @@ -149,7 +149,7 @@ private Object[] resolveParams(HttpContext context) throws ControllerParamsNotMa
break;
}

if ((value == null || value.isEmpty()) && required && !auto)
if (required && !auto && (value == null || value.isEmpty()))
throw new ControllerParamsNotMatchException(String.format("resolve %s failed", params[i].annotation.annotationType().getName()));

try {
Expand Down

0 comments on commit 5c163de

Please sign in to comment.