From c3bf7bd29bf092e3689ba09d109167095eee96f0 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Tue, 6 Sep 2022 16:57:42 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E5=AF=BC=E5=87=BAswagger=E5=86=8D=E5=AF=BC=E5=85=A5=E5=85=B6?= =?UTF-8?q?=E4=BB=96=E5=B9=B3=E5=8F=B0=E7=BC=BA=E5=B0=91=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001016562 --- .../api/dto/definition/parse/Swagger3Parser.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/parse/Swagger3Parser.java b/backend/src/main/java/io/metersphere/api/dto/definition/parse/Swagger3Parser.java index 6473569e74..5e2b6fa203 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/parse/Swagger3Parser.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/parse/Swagger3Parser.java @@ -694,14 +694,9 @@ public class Swagger3Parser extends SwaggerAbstractParser { swaggerParam.setName((String) param.get("name")); swaggerParam.setRequired((boolean) param.get("required")); swaggerParam.setExample((String) param.get("value")); - // 请求头 value 没有导出 -// JSONObject schema = new JSONObject(); -// swaggerParam.setSchema(schema); -// if(type.equals("headers")) { -// schema.put("type", "string"); -// schema.put("example", param.getString("value")); -// swaggerParam.setSchema(schema); -// } + JSONObject schema = new JSONObject(); + schema.put("type", "string"); + swaggerParam.setSchema(schema); paramsList.add(JSON.parseObject(JSON.toJSONString(swaggerParam), Feature.DisableSpecialKeyDetect)); } }