mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-11 21:57:56 +08:00
修复NPE问题
This commit is contained in:
@@ -35,6 +35,9 @@ public class SwaggerDocParser implements DocParser {
|
|||||||
List<DocItem> docItems = new ArrayList<>();
|
List<DocItem> docItems = new ArrayList<>();
|
||||||
|
|
||||||
JSONObject paths = docRoot.getJSONObject("paths");
|
JSONObject paths = docRoot.getJSONObject("paths");
|
||||||
|
if (paths == null) {
|
||||||
|
paths = new JSONObject();
|
||||||
|
}
|
||||||
Set<String> pathNameSet = paths.keySet();
|
Set<String> pathNameSet = paths.keySet();
|
||||||
for (String apiPath : pathNameSet) {
|
for (String apiPath : pathNameSet) {
|
||||||
JSONObject pathInfo = paths.getJSONObject(apiPath);
|
JSONObject pathInfo = paths.getJSONObject(apiPath);
|
||||||
|
Reference in New Issue
Block a user