fix: swagger3 空指针

This commit is contained in:
chenjianxing 2021-03-31 19:39:01 +08:00
parent a2faa2bc87
commit 44b0d7f6ad
1 changed files with 3 additions and 0 deletions

View File

@ -320,6 +320,9 @@ public class Swagger3Parser extends SwaggerAbstractParser {
}
private Object parseSchema(Schema schema, Set<String> refSet, Map<String, Schema> infoMap) {
if (schema == null) {
return new JSONObject();
}
infoMap.put(schema.getName(), schema);
if (StringUtils.isNotBlank(schema.get$ref())) {
if (refSet.contains(schema.get$ref())) {