fix(测试跟踪): json反序列化支持单值转数组
--bug=1018929 --user=陈建星 【测试跟踪】导入7000+用例-选择xmind格式-导入失败 https://www.tapd.cn/55049933/s/1278442
This commit is contained in:
parent
8d843d9dcd
commit
5a3dd75415
|
@ -26,6 +26,7 @@ public class JSON {
|
||||||
objectMapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY);
|
objectMapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY);
|
||||||
// 如果一个对象中没有任何的属性,那么在序列化的时候就会报错
|
// 如果一个对象中没有任何的属性,那么在序列化的时候就会报错
|
||||||
objectMapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
|
objectMapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
|
||||||
|
objectMapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String toJSONString(Object value) {
|
public static String toJSONString(Object value) {
|
||||||
|
|
Loading…
Reference in New Issue