Skip to content

Commit

Permalink
Merge pull request #775 from shalousun/master
Browse files Browse the repository at this point in the history
feat: ignore the collection parameter check.
  • Loading branch information
shalousun authored Mar 29, 2024
2 parents b79b8cd + e39ee58 commit 94065ac
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/com/ly/doc/template/IRestDocTemplate.java
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,10 @@ default ApiMethodReqParam requestParams(final DocJavaMethod docJavaMethod, Proje
boolean isPathVariable = false;
boolean isRequestBody = false;
boolean required = false;
boolean isRequestParam = false;
if (annotations.isEmpty()) {
isRequestParam = true;
}
for (JavaAnnotation annotation : annotations) {
String annotationName = annotation.getType().getValue();
if (ignoreMvcParamWithAnnotation(annotationName)) {
Expand All @@ -610,6 +614,7 @@ default ApiMethodReqParam requestParams(final DocJavaMethod docJavaMethod, Proje
if (frameworkAnnotations.getRequestParamAnnotation().getAnnotationName().equals(annotationName)) {
defaultValueProp = frameworkAnnotations.getRequestParamAnnotation().getDefaultValueProp();
requiredProp = frameworkAnnotations.getRequestParamAnnotation().getRequiredProp();
isRequestParam = true;
}
if (frameworkAnnotations.getPathVariableAnnotation().getAnnotationName().equals(annotationName)) {
defaultValueProp = frameworkAnnotations.getPathVariableAnnotation().getDefaultValueProp();
Expand Down Expand Up @@ -727,7 +732,7 @@ default ApiMethodReqParam requestParams(final DocJavaMethod docJavaMethod, Proje
.setDesc(comment + "(array of file)");
paramList.add(param);
} else {
if (requestBodyCounter > 0) {
if (requestBodyCounter > 0 || !isRequestParam) {
// for json
paramList.addAll(ParamsBuildHelper.buildParams(gicNameArr[0], DocGlobalConstants.EMPTY, 0,
String.valueOf(required), Boolean.FALSE, new HashMap<>(16), builder,
Expand Down

0 comments on commit 94065ac

Please sign in to comment.