diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/parse/Swagger2Parser.java b/backend/src/main/java/io/metersphere/api/dto/definition/parse/Swagger2Parser.java index 439957f149..50f833182d 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/parse/Swagger2Parser.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/parse/Swagger2Parser.java @@ -77,7 +77,7 @@ public class Swagger2Parser extends SwaggerAbstractParser { parseParameters(operation, request); addBodyHeader(request); if (StringUtils.isNotBlank(basePath)) { - String pathStr = basePath + apiDefinition.getPath().replaceAll("//","/"); + String pathStr = (basePath + apiDefinition.getPath()).replaceAll("//","/"); apiDefinition.setPath(pathStr); request.setPath(pathStr); }