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

Commit 94065ac

Browse files
authored
Merge pull request #775 from shalousun/master
feat: ignore the collection parameter check.
2 parents b79b8cd + e39ee58 commit 94065ac

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,10 @@ default ApiMethodReqParam requestParams(final DocJavaMethod docJavaMethod, Proje
598598
boolean isPathVariable = false;
599599
boolean isRequestBody = false;
600600
boolean required = false;
601+
boolean isRequestParam = false;
602+
if (annotations.isEmpty()) {
603+
isRequestParam = true;
604+
}
601605
for (JavaAnnotation annotation : annotations) {
602606
String annotationName = annotation.getType().getValue();
603607
if (ignoreMvcParamWithAnnotation(annotationName)) {
@@ -610,6 +614,7 @@ default ApiMethodReqParam requestParams(final DocJavaMethod docJavaMethod, Proje
610614
if (frameworkAnnotations.getRequestParamAnnotation().getAnnotationName().equals(annotationName)) {
611615
defaultValueProp = frameworkAnnotations.getRequestParamAnnotation().getDefaultValueProp();
612616
requiredProp = frameworkAnnotations.getRequestParamAnnotation().getRequiredProp();
617+
isRequestParam = true;
613618
}
614619
if (frameworkAnnotations.getPathVariableAnnotation().getAnnotationName().equals(annotationName)) {
615620
defaultValueProp = frameworkAnnotations.getPathVariableAnnotation().getDefaultValueProp();
@@ -727,7 +732,7 @@ default ApiMethodReqParam requestParams(final DocJavaMethod docJavaMethod, Proje
727732
.setDesc(comment + "(array of file)");
728733
paramList.add(param);
729734
} else {
730-
if (requestBodyCounter > 0) {
735+
if (requestBodyCounter > 0 || !isRequestParam) {
731736
// for json
732737
paramList.addAll(ParamsBuildHelper.buildParams(gicNameArr[0], DocGlobalConstants.EMPTY, 0,
733738
String.valueOf(required), Boolean.FALSE, new HashMap<>(16), builder,

0 commit comments

Comments
 (0)