swaggerParser RefProperty bug fix (#994)

Co-authored-by: luoyoujun <luoyoujun3712@dingtalk.com>
This commit is contained in:
luoylove 2020-12-28 13:47:25 +08:00 committed by GitHub
parent 79d34a1825
commit 24e89c2c57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -283,6 +283,12 @@ public class Swagger2Parser extends ApiImportAbstractParser {
} else {
jsonObject.put(key, new ArrayList<>());
}
} else if (value instanceof RefProperty) {
RefProperty refProperty = (RefProperty) value;
String simpleRef = refProperty.getSimpleRef();
refSet.add(simpleRef);
Model model = definitions.get(simpleRef);
jsonObject.put(key, getBodyParameters(model.getProperties(), refSet));
} else {
jsonObject.put(key, getDefaultValueByPropertyType(value));
}