From 5edc99809f8aa8e7154e610c37eae13e15275195 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Mon, 13 Feb 2023 17:34:02 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E4=BF=AE=E5=A4=8Dswagger=E7=9A=84xml=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1022544 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001022544 --- .../java/io/metersphere/api/parse/api/Swagger3Parser.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/api-test/backend/src/main/java/io/metersphere/api/parse/api/Swagger3Parser.java b/api-test/backend/src/main/java/io/metersphere/api/parse/api/Swagger3Parser.java index 7cda59f94e..a447819020 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/parse/api/Swagger3Parser.java +++ b/api-test/backend/src/main/java/io/metersphere/api/parse/api/Swagger3Parser.java @@ -499,11 +499,7 @@ public class Swagger3Parser extends SwaggerAbstractParser { if (ref.split("/").length > 3) { ref = ref.replace("#/components/schemas/", StringUtils.EMPTY); } - if (this.components.getSchemas() != null) { - Schema schema = this.components.getSchemas().get(ref); - schema.setName(ref); - return schema; - } + if (this.components.getSchemas() != null) return this.components.getSchemas().get(ref); return null; }