From a686fd605dc9bfb7fb225c0652b838c81be226ab Mon Sep 17 00:00:00 2001 From: shalousun <836575280@qq.com> Date: Sat, 8 Jul 2023 11:19:07 +0800 Subject: [PATCH 1/2] update: delete @required --- CHANGELOG.md | 1 + src/main/java/com/power/doc/constants/DocTags.java | 5 ----- src/main/java/com/power/doc/helper/FormDataBuildHelper.java | 3 --- src/main/java/com/power/doc/helper/ParamsBuildHelper.java | 6 +----- 4 files changed, 2 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f4e9293..9db28791 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ 2. 修复[2.6.9, 2.7.1]版本dubbo rpc重复生成接口文档bug。[#531](https://github.com/smart-doc-group/smart-doc/issues/531) 3. 修改不通类方法接口同名时归档错误问题,[#531](https://github.com/smart-doc-group/smart-doc/issues/534) 4. torna增加version推送,[#535](https://github.com/smart-doc-group/smart-doc/issues/535) + 5. 删除自定义@required tag,@ignore tag不在支持字段忽略。使用jsr规则替代。 ### 版本号:2.7.1 diff --git a/src/main/java/com/power/doc/constants/DocTags.java b/src/main/java/com/power/doc/constants/DocTags.java index 2f21e161..6eef76de 100644 --- a/src/main/java/com/power/doc/constants/DocTags.java +++ b/src/main/java/com/power/doc/constants/DocTags.java @@ -32,11 +32,6 @@ public interface DocTags { */ String SINCE = "since"; - /** - * java required tag - */ - String REQUIRED = "required"; - /** * java param tag */ diff --git a/src/main/java/com/power/doc/helper/FormDataBuildHelper.java b/src/main/java/com/power/doc/helper/FormDataBuildHelper.java index a5b312e6..c61ea977 100644 --- a/src/main/java/com/power/doc/helper/FormDataBuildHelper.java +++ b/src/main/java/com/power/doc/helper/FormDataBuildHelper.java @@ -118,9 +118,6 @@ public static List getFormData(String className, Map r fieldName = StringUtil.camelToUnderline(fieldName); } Map tagsMap = DocUtil.getFieldTagsValue(field, docField); - if (tagsMap.containsKey(DocTags.IGNORE)) { - continue; - } String typeSimpleName = field.getType().getSimpleName(); if (JavaClassValidateUtil.isMap(subTypeName)) { continue; diff --git a/src/main/java/com/power/doc/helper/ParamsBuildHelper.java b/src/main/java/com/power/doc/helper/ParamsBuildHelper.java index 4c68b895..a059948f 100644 --- a/src/main/java/com/power/doc/helper/ParamsBuildHelper.java +++ b/src/main/java/com/power/doc/helper/ParamsBuildHelper.java @@ -248,11 +248,7 @@ public static List buildParams(String className, String pre, int level } comment.append(JavaFieldUtil.getJsrComment(javaAnnotations)); String fieldValue = BaseHelper.getFieldValueFromMock(subTypeName, tagsMap, typeSimpleName); - if (annotationCounter < 1) { - if (tagsMap.containsKey(DocTags.REQUIRED)) { - strRequired = true; - } - } + // cover response value if (Objects.nonNull(customResponseField) && isResp && Objects.nonNull(customResponseField.getValue()) From 3b48aad904ba8a5561ac632e9c0eb8e2f151db25 Mon Sep 17 00:00:00 2001 From: shalousun <836575280@qq.com> Date: Sat, 8 Jul 2023 11:23:05 +0800 Subject: [PATCH 2/2] release 2.7.2 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 266370bd..08393e10 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 smart-doc jar - 2.7.1 + 2.7.2 smart-doc https://github.com/smart-doc-group/smart-doc.git