fix(接口测试): 解决覆盖导入报错以及swagger导出tag问题

--user=郭雨琦
--bug=1014812
https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001014812
--bug=1014699
https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001014699
This commit is contained in:
guoyuqi 2022-07-13 13:35:58 +08:00 committed by xiaomeinvG
parent ddec01f9b0
commit f29e9841ee
2 changed files with 4 additions and 1 deletions

View File

@ -595,6 +595,9 @@ public class Swagger3Parser extends SwaggerAbstractParser {
if (modulePath.contains("/")) { if (modulePath.contains("/")) {
split = modulePath.split("/"); split = modulePath.split("/");
} }
if (split.length == 0 && StringUtils.isNotBlank(modulePath)) {
split = new String[]{modulePath};
}
swaggerApiInfo.setTags(Arrays.asList(split)); swaggerApiInfo.setTags(Arrays.asList(split));
} }

View File

@ -897,7 +897,7 @@ public class ApiDefinitionService {
apiDefinition.setCreateTime(System.currentTimeMillis()); apiDefinition.setCreateTime(System.currentTimeMillis());
apiDefinition.setUpdateTime(System.currentTimeMillis()); apiDefinition.setUpdateTime(System.currentTimeMillis());
if (apiDefinition.getVersionId().equals("update")) { if (apiDefinition.getVersionId() != null && apiDefinition.getVersionId().equals("update")) {
if (StringUtils.isNotEmpty(apiTestImportRequest.getUpdateVersionId())) { if (StringUtils.isNotEmpty(apiTestImportRequest.getUpdateVersionId())) {
apiDefinition.setVersionId(apiTestImportRequest.getUpdateVersionId()); apiDefinition.setVersionId(apiTestImportRequest.getUpdateVersionId());
} else { } else {