Skip to content
New issue

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

[QUESTION]springboot用fastjson2返回数据,LocalDate和LocalTime格式化问题 #1003

Closed
wugui0823 opened this issue Dec 9, 2022 · 3 comments
Labels
bug Something isn't working fixed question Further information is requested
Milestone

Comments

@wugui0823
Copy link

wugui0823 commented Dec 9, 2022

fastjson2版本:2.0.20
springboot配置
image

属性注解
image

返回结果
image

之前看到issues有提高LocalDate、LocalTime会有默认的格式yyyy-MM-dd和HH:mm:ss,但是我试了下没有效果,不知道是不是我配置问题.
不知道fastjson2是否支持spring自带的fasterxml jackson注解

@wugui0823 wugui0823 added the question Further information is requested label Dec 9, 2022
@wenshao wenshao added this to the 2.0.21 milestone Dec 9, 2022
@wenshao
Copy link
Member

wenshao commented Dec 9, 2022

已经支持通过Jackson Annotation JsonFormat,fastjson2也支持JSONField(format="xxx")的方式配置日期格式

https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/fastjson2/2.0.21-SNAPSHOT/
问题已经修复,请用最新快照版本2.0.21-SNAPSHOT版本帮忙验证

@wenshao wenshao added bug Something isn't working fixed labels Dec 10, 2022
@wenshao
Copy link
Member

wenshao commented Dec 10, 2022

https://github.com/alibaba/fastjson2/releases/tag/2.0.21
问题已修复,请用新版本

@wenshao wenshao closed this as completed Dec 10, 2022
@wugui0823
Copy link
Author

升级后可以了,谢谢

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working fixed question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants