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 3d7d8a2d0f..716a0faada 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 @@ -37,7 +37,7 @@ public class Swagger2Parser extends SwaggerAbstractParser { swagger = new SwaggerParser().read(request.getSwaggerUrl(), auths, true); } else { sourceStr = getApiTestStr(source); // 导入的二进制文件转换为 String - swagger = new SwaggerParser().readWithInfo(sourceStr, auths, true).getSwagger(); + swagger = new SwaggerParser().readWithInfo(sourceStr).getSwagger(); } if (swagger == null || swagger.getSwagger() == null) { // 不是 2.0 版本,则尝试转换 3.0 Swagger3Parser swagger3Parser = new Swagger3Parser(); diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/parse/Swagger3Parser.java b/backend/src/main/java/io/metersphere/api/dto/definition/parse/Swagger3Parser.java index 44181590a1..65c0ecfb0e 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/parse/Swagger3Parser.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/parse/Swagger3Parser.java @@ -57,7 +57,7 @@ public class Swagger3Parser extends SwaggerAbstractParser { if (StringUtils.isNotBlank(request.getSwaggerUrl())) { result = new OpenAPIParser().readLocation(request.getSwaggerUrl(), auths, null); } else { - result = new OpenAPIParser().readContents(sourceStr, auths, null); + result = new OpenAPIParser().readContents(sourceStr, null, null); } if (result == null) { MSException.throwException("解析失败,请确认选择的是 swagger 格式!");