From 1dd7c4edfad2fd6d774bbc6e9b55cc0f4d7cc5a4 Mon Sep 17 00:00:00 2001 From: oppofind <836575280@qq.com> Date: Wed, 15 Jul 2020 23:47:45 +0800 Subject: [PATCH] fix gitee #I1NLDI --- src/main/java/com/power/doc/utils/JavaClassUtil.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/com/power/doc/utils/JavaClassUtil.java b/src/main/java/com/power/doc/utils/JavaClassUtil.java index daf96aa..4faa86d 100644 --- a/src/main/java/com/power/doc/utils/JavaClassUtil.java +++ b/src/main/java/com/power/doc/utils/JavaClassUtil.java @@ -266,6 +266,11 @@ public class JavaClassUtil { List validates = DocValidatorAnnotationEnum.listValidatorAnnotations(); List annotationValueList = getAnnotationValues(validates, javaAnnotation); addGroupClass(annotationValueList, javaClassList); + String simpleAnnotationName = javaAnnotation.getType().getValue(); + // add default group + if (javaClassList.size() == 0 && JavaClassValidateUtil.isJSR303Required(simpleAnnotationName)) { + javaClassList.add("javax.validation.groups.Default"); + } return javaClassList; } @@ -305,6 +310,7 @@ public class JavaClassUtil { /** * Get Map of final field and value + * * @param clazz Java class * @return Map * @throws IllegalAccessException IllegalAccessException