feat:适配JSON序列化Record类

#3931
This commit is contained in:
xxxtea
2025-10-10 18:13:35 +08:00
parent aa488485cc
commit 0d2f3f4ed3

View File

@@ -1,6 +1,7 @@
package cn.hutool.json;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.RecordUtil;
import cn.hutool.core.collection.ArrayIter;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.io.IoUtil;
@@ -112,6 +113,8 @@ public class ObjectMapper {
// 普通Bean
// TODO 过滤器对Bean无效需补充。
mapFromBean(source, jsonObject);
} else if (RecordUtil.isRecord(source.getClass())) {
mapFromBean(source, jsonObject);
}
// 跳过空对象