!2 Bugfix:接口文档解析NPE

Merge pull request !2 from bigbenfather/master
pull/2/MERGE tag-3.2.0
tanghc 5 years ago committed by Gitee
commit a1f2954544
  1. 5
      sop-website/src/main/java/com/gitee/sop/websiteserver/manager/SwaggerDocParser.java

@ -208,8 +208,11 @@ public class SwaggerDocParser implements DocParser {
protected List<DocParameter> buildDocParameters(String ref, JSONObject docRoot, boolean doSubRef) {
JSONObject responseObject = docRoot.getJSONObject("definitions").getJSONObject(ref);
JSONObject properties = responseObject.getJSONObject("properties");
Set<String> fieldNames = properties.keySet();
List<DocParameter> docParameterList = new ArrayList<>();
if (properties == null) {
return docParameterList;
}
Set<String> fieldNames = properties.keySet();
for (String fieldName : fieldNames) {
/*
{

Loading…
Cancel
Save