Skip to content

Commit b492b76

Browse files
committed
Java:远程函数 verifyIdList 和 verifyURLList 对 null 放行,如果必传可用 Request 表 structure 字段中 MUST 操作符实现
1 parent 0c5d600 commit b492b76

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

APIJSON-Java-Server/APIJSONBoot/src/main/java/apijson/demo/DemoFunctionParser.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ public DemoFunctionParser(RequestMethod method, String tag, int version, JSONObj
5252
*/
5353
public Object verifyIdList(@NotNull JSONObject current, @NotNull String idList) throws Exception {
5454
Object obj = current.get(idList);
55+
if (obj == null) {
56+
return null;
57+
}
58+
5559
if (obj instanceof Collection == false) {
5660
throw new IllegalArgumentException(idList + " 不符合 Array 类型! 结构必须是 [] !");
5761
}
@@ -74,6 +78,10 @@ public Object verifyIdList(@NotNull JSONObject current, @NotNull String idList)
7478
*/
7579
public Object verifyURLList(@NotNull JSONObject current, @NotNull String urlList) throws Exception {
7680
Object obj = current.get(urlList);
81+
if (obj == null) {
82+
return null;
83+
}
84+
7785
if (obj instanceof Collection == false) {
7886
throw new IllegalArgumentException(urlList + " 不符合 Array 类型! 结构必须是 [] !");
7987
}

0 commit comments

Comments
 (0)