fix: swagger2.0 导入失败
This commit is contained in:
parent
5cbaeb06c4
commit
aa53e696cc
|
@ -220,16 +220,20 @@ public class Swagger2Parser extends SwaggerAbstractParser {
|
||||||
//模型数组
|
//模型数组
|
||||||
ArrayModel arrayModel = (ArrayModel) schema;
|
ArrayModel arrayModel = (ArrayModel) schema;
|
||||||
Property items = arrayModel.getItems();
|
Property items = arrayModel.getItems();
|
||||||
|
JSONArray propertyList = new JSONArray();
|
||||||
if (items instanceof RefProperty) {
|
if (items instanceof RefProperty) {
|
||||||
RefProperty refProperty = (RefProperty) items;
|
RefProperty refProperty = (RefProperty) items;
|
||||||
String simpleRef = refProperty.getSimpleRef();
|
String simpleRef = refProperty.getSimpleRef();
|
||||||
HashSet<String> refSet = new HashSet<>();
|
HashSet<String> refSet = new HashSet<>();
|
||||||
refSet.add(simpleRef);
|
refSet.add(simpleRef);
|
||||||
Model model = definitions.get(simpleRef);
|
Model model = definitions.get(simpleRef);
|
||||||
JSONArray propertyList = new JSONArray();
|
if (model != null) {
|
||||||
propertyList.add(getBodyParameters(model.getProperties(), refSet));
|
propertyList.add(getBodyParameters(model.getProperties(), refSet));
|
||||||
return propertyList.toString();
|
} else {
|
||||||
|
propertyList.add(new JSONObject());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return propertyList.toString();
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue