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

fastjson2 序列化兼容问题 #2446

Closed
bodhili opened this issue Apr 15, 2024 · 2 comments
Closed

fastjson2 序列化兼容问题 #2446

bodhili opened this issue Apr 15, 2024 · 2 comments
Labels
bug Something isn't working fixed question Further information is requested
Milestone

Comments

@bodhili
Copy link
Contributor

bodhili commented Apr 15, 2024

请描述您的问题

询问有关本项目的使用和其他方面的相关问题。

fastjson2 序列化 java.time.Period,
Period period = Period.ofDays(2)
如何兼容fastjson,输出为“P2D”这种形式

重现方式: String json = JSON.toJSONString(period);
问题:fastjson 和 fastjson2输出结果不一致, 如何让fastjson2 与 fastjson输出结果一致 ?

上述序列化方式:fastjson 会调用 Period toString 方法,而 fastjson2 不会

@bodhili bodhili added the question Further information is requested label Apr 15, 2024
@wenshao wenshao added this to the 2.0.50 milestone Apr 16, 2024
@wenshao
Copy link
Member

wenshao commented Apr 16, 2024

https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/fastjson2/2.0.50-SNAPSHOT/
已经支持,请帮忙用2.0.50-SNAPSHOT版本验证

@wenshao wenshao added fixed bug Something isn't working labels Apr 16, 2024
@wenshao
Copy link
Member

wenshao commented May 12, 2024

https://github.com/alibaba/fastjson2/releases/tag/2.0.50
2.0.50已发布,请用新版本

@wenshao wenshao closed this as completed May 12, 2024
# 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