fix: swagger2引用的实体对象没定义会报错

--bug=1009407 --user=陈建星 [ github#8970]接口导入:swagger 2.0 json文件导入后,有些接口参数没有导入到MeterSphere系统里。 https://www.tapd.cn/55049933/s/10885833
This commit is contained in:
chenjianxing 2021-12-30 13:45:28 +08:00 committed by fit2-zhao
parent a29e9951f8
commit 94b3694dfb
1 changed files with 2 additions and 0 deletions

View File

@ -100,6 +100,8 @@ public class Swagger2Parser extends SwaggerAbstractParser {
Set<String> pathNames = paths.keySet();
this.definitions = swagger.getDefinitions();
if (this.definitions == null)
this.definitions = new HashMap<>();
List<ApiDefinitionWithBLOBs> results = new ArrayList<>();