Skip to content
This repository was archived by the owner on Dec 4, 2025. It is now read-only.

Commit b79b8cd

Browse files
authored
Merge pull request #774 from shalousun/master
feat: after adding custom annotations to parameters, ignore the collection parameter check.
2 parents 394375d + d779b50 commit b79b8cd

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/main/java/com/ly/doc/template/IRestDocTemplate.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -893,6 +893,9 @@ default ApiRequestExample buildReqJson(DocJavaMethod javaMethod, ApiMethodDoc ap
893893
Set<String> groupClasses = JavaClassUtil.getParamGroupJavaClass(annotations, configBuilder.getJavaProjectBuilder());
894894
boolean paramAdded = false;
895895
boolean requestParam = false;
896+
if (annotations.isEmpty()) {
897+
requestParam = true;
898+
}
896899
for (JavaAnnotation annotation : annotations) {
897900
String annotationName = annotation.getType().getValue();
898901
String fullName = annotation.getType().getSimpleName();
@@ -998,7 +1001,8 @@ default ApiRequestExample buildReqJson(DocJavaMethod javaMethod, ApiMethodDoc ap
9981001
gicName = gicName.substring(0, gicName.indexOf("["));
9991002
}
10001003
if (!JavaClassValidateUtil.isPrimitive(gicName)
1001-
&& !configBuilder.getJavaProjectBuilder().getClassByName(gicName).isEnum()) {
1004+
&& !configBuilder.getJavaProjectBuilder().getClassByName(gicName).isEnum()
1005+
&& requestParam) {
10021006
throw new RuntimeException("can't support binding Collection on method "
10031007
+ method.getName() + " Check it in " + method.getDeclaringClass().getCanonicalName());
10041008
}

0 commit comments

Comments
 (0)