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