fix(接口测试): 修复json-schema预览报错空指针的缺陷

--bug=1033026 --user=王孝刚
【接口测试】接口定义-编辑接口的请求体的json-schema格式,导入后模版和预览显示还是原始的
https://www.tapd.cn/55049933/s/1437834
This commit is contained in:
wxg0103 2023-11-17 18:48:06 +08:00 committed by 刘瑞斌
parent 4712d98627
commit 6dd115cb5e
1 changed files with 1 additions and 1 deletions

View File

@ -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);