diff --git a/backend/src/main/java/io/metersphere/api/parse/Swagger2Parser.java b/backend/src/main/java/io/metersphere/api/parse/Swagger2Parser.java index 0cd0d62e18..b6471f413c 100644 --- a/backend/src/main/java/io/metersphere/api/parse/Swagger2Parser.java +++ b/backend/src/main/java/io/metersphere/api/parse/Swagger2Parser.java @@ -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());