From c3f9c1fc0052243c26d8fabc3daa873d59b37ba0 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Thu, 24 Jun 2021 10:44:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20swagger2=E5=93=8D=E5=BA=94=E8=A7=A3?= =?UTF-8?q?=E6=9E=90=E4=B8=8D=E5=AE=8C=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/dto/definition/parse/Swagger2Parser.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 5084926451..6966755940 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 @@ -294,7 +294,14 @@ public class Swagger2Parser extends SwaggerAbstractParser { propertyList.add(new JSONObject()); } jsonObject.put(key, propertyList); - } else { + } else if (items instanceof ObjectProperty) { + JSONArray propertyList = new JSONArray(); + if (items != null) { + propertyList.add(getBodyParameters(((ObjectProperty) items).getProperties(), refSet)); + } + jsonObject.put(key, propertyList); + } + else { jsonObject.put(key, new ArrayList<>()); } } else if (value instanceof RefProperty) {