From 2971fc5000fc92815c5fe4f526bcc3ac9842b7e6 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Tue, 30 May 2023 18:23:34 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8Dswagger=E5=AF=BC=E5=85=A5=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E5=93=8D=E5=BA=94=E5=86=85=E5=AE=B9=E7=9A=84=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1026582 --user=王孝刚 【接口测试】github#24656,【接口测试】同一个接口导出成MeterSphere格式和swagger格式后,再次导入系统后,swagger响应数据的展示内容不对。 https://www.tapd.cn/55049933/s/1377196 --- .../main/java/io/metersphere/api/parse/api/Swagger3Parser.java | 3 +++ 1 file changed, 3 insertions(+) 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 9d10c9a08e..38cb2d35b7 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 @@ -534,6 +534,9 @@ public class Swagger3Parser extends SwaggerAbstractParser { }); } item.getMock().put(PropertyConstant.MOCK, JSONUtil.toJSONString(mock)); + if (arrayItem != null) { + item.getItems().add(arrayItem); + } } else if (schema instanceof ObjectSchema) { item.setType(PropertyConstant.OBJECT); item.setProperties(parseSchemaProperties(schema, refSet));