fastjson 对象中的对象字段中的私有属性序列化失败,已配置fieldBase为true

13z8s7eq  于 2021-11-27  发布在  Java
关注(0)|答案(1)|浏览(316)
public class JavaBeanTest {
    private int anInt;
    private State state;
    private String string;
    private JavaBean2 javaBean2;
}
public class JavaBean2 {
    private int anInt;
    private State state;
    private String string;
}

测试JSON.toJSON(javaBeanTest, new SerializeConfig(true))

结果:{"string":"hello json","anInt":15,"state":"LOGIN","javaBean2":{}}

相关问题