We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
引用版本:fastjson2-2.0.7-20220608.134803-35
配置信息:
FastJsonConfig config = new FastJsonConfig(); // 这里如果设置了FieldBased,@JSONField注解就生不效了 config.setWriterFeatures(JSONWriter.Feature.FieldBased, JSONWriter.Feature.NullAsDefaultValue); // 如果去除JSONWriter.Feature.FieldBased,@JSONField注解就生效了 // config.setWriterFeatures(JSONWriter.Feature.NullAsDefaultValue);
返回实体字段: @JSONField(format = "yyyy-MM-dd HH") private Date history; @JSONField(format = "yyyy-MM-dd") private LocalDate yesterday; @JSONField(format = "yyyy-MM-dd HH:mm") private java.sql.Date tomorrow;
期望:{"current":"2022-06-09 00:11:10","history":"2022-06-09 00","tomorrow":"2022-06-09 00:11","yesterday":"2022-06-09"}
实际 :{"current":"2022-06-09 00:19:35","history":"2022-06-09 00:19:35","tomorrow":"2022-06-09 00:19:35","yesterday":"2022-06-09 00:00:00"}
疑问:文档中对FieldBased的描述是,”FieldBased | 基于字段反序列化,如果不配置,会默认基于public的field和getter方法序列化。配置后,会基于非static的field(包括private)做反序列化“。
详情见:https://github.com/youandeanyou/springboot-demo
访问:http://localhost:8081/test 即可。
The text was updated successfully, but these errors were encountered:
https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/fastjson2/2.0.7-SNAPSHOT/ 已经支持,请用2.0.7-SNAPSHOT版本验证
Sorry, something went wrong.
bug for fieldBased annotation process, fix issue #445
6c74430
https://github.com/alibaba/fastjson2/releases/tag/2.0.7 问题已经修复,请用新版本
No branches or pull requests
引用版本:fastjson2-2.0.7-20220608.134803-35
配置信息:
返回实体字段:
@JSONField(format = "yyyy-MM-dd HH")
private Date history;
@JSONField(format = "yyyy-MM-dd")
private LocalDate yesterday;
@JSONField(format = "yyyy-MM-dd HH:mm")
private java.sql.Date tomorrow;
期望:{"current":"2022-06-09 00:11:10","history":"2022-06-09 00","tomorrow":"2022-06-09 00:11","yesterday":"2022-06-09"}
实际 :{"current":"2022-06-09 00:19:35","history":"2022-06-09 00:19:35","tomorrow":"2022-06-09 00:19:35","yesterday":"2022-06-09 00:00:00"}
疑问:文档中对FieldBased的描述是,”FieldBased | 基于字段反序列化,如果不配置,会默认基于public的field和getter方法序列化。配置后,会基于非static的field(包括private)做反序列化“。
详情见:https://github.com/youandeanyou/springboot-demo
访问:http://localhost:8081/test 即可。
The text was updated successfully, but these errors were encountered: