From 015b0848557f6fb9fe9acf90e8612f4067475c4d Mon Sep 17 00:00:00 2001 From: tanghc Date: Wed, 6 Nov 2019 16:41:29 +0800 Subject: [PATCH] =?UTF-8?q?JSR-303=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gitee/sop/servercommon/param/ApiArgumentResolver.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/param/ApiArgumentResolver.java b/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/param/ApiArgumentResolver.java index 11f2ece3..97d53c50 100644 --- a/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/param/ApiArgumentResolver.java +++ b/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 ) throws Exception { 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) { // JSR-303验证 paramValidator.validateBizParam(paramObj); - return paramObj; + return ret; } } HandlerMethodArgumentResolver resolver = getOtherArgumentResolver(methodParameter);