Skip to content

Commit

Permalink
Merge pull request #774 from shalousun/master
Browse files Browse the repository at this point in the history
feat: after adding custom annotations to parameters, ignore the collection parameter check.
  • Loading branch information
shalousun authored Mar 29, 2024
2 parents 394375d + d779b50 commit b79b8cd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/com/ly/doc/template/IRestDocTemplate.java
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,9 @@ default ApiRequestExample buildReqJson(DocJavaMethod javaMethod, ApiMethodDoc ap
Set<String> groupClasses = JavaClassUtil.getParamGroupJavaClass(annotations, configBuilder.getJavaProjectBuilder());
boolean paramAdded = false;
boolean requestParam = false;
if (annotations.isEmpty()) {
requestParam = true;
}
for (JavaAnnotation annotation : annotations) {
String annotationName = annotation.getType().getValue();
String fullName = annotation.getType().getSimpleName();
Expand Down Expand Up @@ -998,7 +1001,8 @@ default ApiRequestExample buildReqJson(DocJavaMethod javaMethod, ApiMethodDoc ap
gicName = gicName.substring(0, gicName.indexOf("["));
}
if (!JavaClassValidateUtil.isPrimitive(gicName)
&& !configBuilder.getJavaProjectBuilder().getClassByName(gicName).isEnum()) {
&& !configBuilder.getJavaProjectBuilder().getClassByName(gicName).isEnum()
&& requestParam) {
throw new RuntimeException("can't support binding Collection on method "
+ method.getName() + " Check it in " + method.getDeclaringClass().getCanonicalName());
}
Expand Down

0 comments on commit b79b8cd

Please sign in to comment.