diff --git a/framework/sdk-parent/sdk/src/main/java/io/metersphere/commons/utils/JSON.java b/framework/sdk-parent/sdk/src/main/java/io/metersphere/commons/utils/JSON.java index 1dc06389a1..7ad9f26959 100644 --- a/framework/sdk-parent/sdk/src/main/java/io/metersphere/commons/utils/JSON.java +++ b/framework/sdk-parent/sdk/src/main/java/io/metersphere/commons/utils/JSON.java @@ -1,13 +1,10 @@ package io.metersphere.commons.utils; -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.PropertyAccessor; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.databind.type.CollectionType; import com.fasterxml.jackson.databind.type.TypeFactory; @@ -22,10 +19,6 @@ public class JSON { static { objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - // 自动检测所有类的全部属性 - objectMapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY); - // 如果一个对象中没有任何的属性,那么在序列化的时候就会报错 - objectMapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS); } public static String toJSONString(Object value) {