From 6dd115cb5e00d75cf1ef900d655e60745d79fd4a Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Fri, 17 Nov 2023 18:48:06 +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=8Djson-schema=E9=A2=84=E8=A7=88=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E7=A9=BA=E6=8C=87=E9=92=88=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=1033026 --user=王孝刚 【接口测试】接口定义-编辑接口的请求体的json-schema格式,导入后模版和预览显示还是原始的 https://www.tapd.cn/55049933/s/1437834 --- .../io/metersphere/api/exec/generator/JSONSchemaBuilder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api-test/backend/src/main/java/io/metersphere/api/exec/generator/JSONSchemaBuilder.java b/api-test/backend/src/main/java/io/metersphere/api/exec/generator/JSONSchemaBuilder.java index e845598ed9..fc0b7c657d 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/exec/generator/JSONSchemaBuilder.java +++ b/api-test/backend/src/main/java/io/metersphere/api/exec/generator/JSONSchemaBuilder.java @@ -116,7 +116,7 @@ public class JSONSchemaBuilder { propertyObjType = object.get(PropertyConstant.TYPE).getAsString(); } if (propertyObjType.equals(PropertyConstant.STRING) || propertyObjType.equals(PropertyConstant.ENUM)) { - concept.put(propertyName, FormatterUtil.getMockValue(object)); + concept.put(propertyName, object.has(PropertyConstant.MOCK) ? FormatterUtil.getMockValue(object) : StringUtils.EMPTY); } else if (propertyObjType.equals(PropertyConstant.INTEGER) || propertyObjType.equals(PropertyConstant.NUMBER)) { try { concept.put(propertyName, 0);