diff --git a/src/main/java/com/ly/doc/template/IRestDocTemplate.java b/src/main/java/com/ly/doc/template/IRestDocTemplate.java index d9a07cf6..2a560d38 100644 --- a/src/main/java/com/ly/doc/template/IRestDocTemplate.java +++ b/src/main/java/com/ly/doc/template/IRestDocTemplate.java @@ -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)) { @@ -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(); @@ -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,