张治保

Results 67 comments of 张治保

哦,没有无参构造方法是不?

没复现, 你检查下哪里配置的不一致 ```java public class Issue2230 { @Test void test(){ JSONObject dfDtoJson = new JSONObject(); dfDtoJson.put( "componentList", new JSONArray().fluentAdd( new JSONObject().fluentPut( "props", new JSONObject() .fluentPut("compTypeName", "test11") .fluentPut("name", "test22") ) )...

给这个方法加上`@JSONField(deserialize = false)` ```java @Data static class DynFormComponentDto implements Serializable { private JSONObject props; // 组件完整配置 // 这个方法会导致props字段反序列化结果出现{"h":{***}}结构 @JSONField(deserialize = false) public DynFormComponentDto props(IFormComponent comp) { this.props = JSONObject.from(comp, JSONWriter.Feature.FieldBased);...

这是个不安全的特性,现在使用 AutoTypeBeforeHandler 、JSONReader.autoTypeFilter()实现

看起来是可以的, `com.alibaba.fastjson2.filter.ContextAutoTypeBeforeHandler#ContextAutoTypeBeforeHandler(boolean, java.lang.String...)` 这里已经内置了一些类型的支持,额外的需要自己补充

https://alibaba.github.io/fastjson2/features_cn.html 没开启 fieldbase 默认基于 getter序列化,所以可能是有getStability方法,序列化时会执行这个方法

这不是一个JSONObject格式的数据,可以使用 `JSON.toJSON`,这个方法可能返回 JSONObject、JSONArray 或其它类型

因为有循环引用,导致 toString 一直在递归,把循环引用解开就可以了 比如 ``` @ToString.Exclude private StationNode nextStation; ```