【新增】Jackson序列化配置,支持null值转为数据类型初始值

【新增】Jackson序列化配置,支持null值转为数据类型初始值

Signed-off-by: bubu <8096927+bubu-space@user.noreply.gitee.com>
pull/252/head
bubu 2025-04-14 06:20:25 +00:00 committed by Gitee
parent 5a3fb9310c
commit a8626b0b9f
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 2 additions and 0 deletions

View File

@ -95,6 +95,8 @@ public class JacksonConfig {
gen.writeNumber(0);
} else if (type == Boolean.class) {
gen.writeBoolean(false);
} else if (type == Date.class) {
gen.writeString("");
} else if (type.isArray() || Collection.class.isAssignableFrom(type)) {
gen.writeStartArray();
gen.writeEndArray();