refactor(接口测试): swagger 导入请求名称使用Summary

This commit is contained in:
chenjianxing 2020-10-26 10:57:04 +08:00
parent a7a2f495d6
commit 76455e54a5
1 changed files with 5 additions and 1 deletions

View File

@ -50,7 +50,11 @@ public class Swagger2Parser extends ApiImportAbstractParser {
for (HttpMethod method : httpMethods) {
Operation operation = operationMap.get(method);
HttpRequest request = new HttpRequest();
request.setName(operation.getOperationId());
if (StringUtils.isNotBlank(operation.getSummary())) {
request.setName(operation.getSummary());
} else {
request.setName(operation.getOperationId());
}
request.setPath(pathName);
request.setUseEnvironment(true);
request.setMethod(method.name());