Skip to content

Commit 8328a61

Browse files
committed
Null处理
1 parent 4ee2174 commit 8328a61

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

apidoc-core/src/main/java/com/ztianzeng/apidoc/Reader.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,10 @@ public OpenAPI read(Class<?> cls) {
8484
BeanDescription beanDesc = mapper.getSerializationConfig().introspect(targetType);
8585

8686

87+
8788
// 处理方法
8889
for (JavaMethod method : classByName.getMethods()) {
90+
boolean isRquestMapping = false;
8991
RequestMethod methodType = null;
9092
boolean deprecated = false;
9193
String url = null;
@@ -94,14 +96,17 @@ public OpenAPI read(Class<?> cls) {
9496
if (isRequestMapping(annotation)) {
9597
url = getRequestMappingUrl(annotation);
9698
methodType = getRequestMappingMethod(annotation);
97-
99+
isRquestMapping = true;
98100
}
99101

100102
if (annotation.getType().isA("java.lang.Deprecated")) {
101103
deprecated = true;
102104
}
103105

104106
}
107+
if (!isRquestMapping) {
108+
continue;
109+
}
105110

106111
if (url != null) {
107112
url = url.replaceAll("\"", "").trim();

apidoc-core/src/test/java/com/ztianzeng/apidoc/test/res/TestController.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,8 @@ public Result<CreateParam> get2(@RequestParam(value = "userId", required = false
6464
@RequestParam(value = "sex2") String sex) {
6565
return new Result<>();
6666
}
67+
68+
private void a() {
69+
70+
}
6771
}

0 commit comments

Comments
 (0)