JSR-303优化

pull/1/head
tanghc 5 years ago
parent 48395c396c
commit 015b084855
  1. 8
      sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/param/ApiArgumentResolver.java

@ -124,11 +124,15 @@ public class ApiArgumentResolver implements SopHandlerMethodArgumentResolver {
, WebDataBinderFactory webDataBinderFactory , WebDataBinderFactory webDataBinderFactory
) throws Exception { ) throws Exception {
if (openApiParams.contains(methodParameter)) { if (openApiParams.contains(methodParameter)) {
Object paramObj = this.getParamObject(methodParameter, nativeWebRequest); Object ret = this.getParamObject(methodParameter, nativeWebRequest);
Object paramObj = ret;
if (paramObj instanceof OpenContext) {
paramObj = ((OpenContext) paramObj).getBizObject();
}
if (paramObj != null) { if (paramObj != null) {
// JSR-303验证 // JSR-303验证
paramValidator.validateBizParam(paramObj); paramValidator.validateBizParam(paramObj);
return paramObj; return ret;
} }
} }
HandlerMethodArgumentResolver resolver = getOtherArgumentResolver(methodParameter); HandlerMethodArgumentResolver resolver = getOtherArgumentResolver(methodParameter);

Loading…
Cancel
Save