From 8668715ceb514cb9ea82128124c2ef0e01a588fc Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Mon, 28 Nov 2022 15:49:45 +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=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --user=郭雨琦 --- .../java/io/metersphere/api/parse/api/Swagger3Parser.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 319b9215c4..49ab47752d 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 @@ -350,7 +350,9 @@ public class Swagger3Parser extends SwaggerAbstractParser { JsonSchemaItem jsonSchemaItem = parseSchema(schema, refSet); if (jsonSchemaItem == null) { jsonSchemaItem = new JsonSchemaItem(); - jsonSchemaItem.setType(schema.getType()); + if (StringUtils.isNotBlank(schema.getType())) { + jsonSchemaItem.setType(schema.getType()); + } } if (MapUtils.isEmpty(jsonSchemaItem.getProperties())) { jsonSchemaItem.setProperties(new HashMap<>());