From b15910316edaf62ba68114ff2400b52ba349cda0 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Fri, 30 Dec 2022 14:57:39 +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=8D=E7=94=B1=E4=BA=8E=E4=BF=AE=E6=94=B9=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=AF=BC=E5=85=A5=E5=AF=B9example=E5=A4=84=E7=90=86?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E8=80=8C=E4=BA=A7=E7=94=9F=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1021408--user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001021408 --- .../main/java/io/metersphere/api/parse/api/Swagger3Parser.java | 2 +- 1 file changed, 1 insertion(+), 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 4c8499928d..78d9c6fd29 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 @@ -330,7 +330,7 @@ public class Swagger3Parser extends SwaggerAbstractParser { Set refSet = new HashSet<>(); Map infoMap = new HashMap(); Schema schema = getSchema(mediaType.getSchema()); - if (content.get(contentType).getExample() != null && schema.getExample() == null) { + if (content.get(contentType) != null && content.get(contentType).getExample() != null && schema.getExample() == null) { schema.setExample(content.get(contentType).getExample()); } Object bodyData = null;