fix: swagger不选模块导入报错

This commit is contained in:
chenjianxing 2021-07-26 15:43:38 +08:00 committed by jianxing
parent 41c04b90b3
commit 8e27594fe6
1 changed files with 4 additions and 2 deletions

View File

@ -13,8 +13,10 @@ public abstract class SwaggerAbstractParser extends ApiImportAbstractParser<ApiD
protected void buildModule(ApiModule parentModule, ApiDefinitionWithBLOBs apiDefinition,
List<String> tags, String selectModulePath) {
if (CollectionUtils.isEmpty(tags)) {
apiDefinition.setModuleId(parentModule.getId());
apiDefinition.setModulePath(selectModulePath);
if (parentModule != null) {
apiDefinition.setModuleId(parentModule.getId());
apiDefinition.setModulePath(selectModulePath);
}
} else {
tags.forEach(tag -> {
ApiModule module = ApiDefinitionImportUtil.buildModule(parentModule, tag, this.projectId);