fix: swagger 导入栈溢出
This commit is contained in:
parent
1ed90fdd63
commit
7270c24eb2
|
@ -275,6 +275,11 @@ public class Swagger2Parser extends ApiImportAbstractParser {
|
||||||
} else if (value instanceof RefProperty) {
|
} else if (value instanceof RefProperty) {
|
||||||
RefProperty refProperty = (RefProperty) value;
|
RefProperty refProperty = (RefProperty) value;
|
||||||
String simpleRef = refProperty.getSimpleRef();
|
String simpleRef = refProperty.getSimpleRef();
|
||||||
|
if (refSet.contains(simpleRef)) {
|
||||||
|
//避免嵌套死循环
|
||||||
|
jsonObject.put(key, new JSONArray());
|
||||||
|
return;
|
||||||
|
}
|
||||||
refSet.add(simpleRef);
|
refSet.add(simpleRef);
|
||||||
Model model = definitions.get(simpleRef);
|
Model model = definitions.get(simpleRef);
|
||||||
jsonObject.put(key, getBodyParameters(model.getProperties(), refSet));
|
jsonObject.put(key, getBodyParameters(model.getProperties(), refSet));
|
||||||
|
|
Loading…
Reference in New Issue