-
Notifications
You must be signed in to change notification settings - Fork 495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@JSONField(format="")设置无效 #380
Comments
问题已经修复,请用2.0.6-SNAPSHOT版本验证,2.0.6正式版预计6月5日前发布 |
温少,我想问一下,这快照如何引用,仓库地址要改成哪个? |
已验证,已解决。 我还有个疑问,关于FieldBased的。 我看文档中,关于FieldBased描述是:“基于字段反序列化,如果不配置,会默认基于public的field和getter方法序列化。配置后,会基于非static的field(包括private)做反序列化。”。为什么会有这样的问题? |
有一个问题,和这个bug是类似的,在fastjson1中,设置所有date 的默认格式可以这样写 但是在fastjson2的2.0.6中JSONWrite.Feature中好像不支持了? |
@youandeanyou @xionggit 不同的问题不要在同一个issue里讨论,要不然会漏了 |
2.0.5版本中,实体类中时间字段设置@JSONField(format="")注解后,只有JSON.toJSONString()可以生效,但对外输出只依赖全局设置的dateFormat。
示例代码:
https://github.com/youandeanyou/springboot-demo
访问 http://localhost:8081/test
期望结果:{"current":"2022-05-30 10:35:56","history":"2022-05-30 10","tomorrow":"2022-05-30 10:35","yesterday":"2022-05-30"}
实际结果:{"current":"2022-05-30 10:35:56","history":"2022-05-30 10:35:56","tomorrow":"2022-05-30 10:35:56","yesterday":"2022-05-30 00:00:00"}
The text was updated successfully, but these errors were encountered: