Skip to content
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

[BUG] fastjson2 针对MutablePair序列化的结果多出字段 #608

Closed
tangjwtj opened this issue Aug 3, 2022 · 1 comment
Closed

[BUG] fastjson2 针对MutablePair序列化的结果多出字段 #608

tangjwtj opened this issue Aug 3, 2022 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@tangjwtj
Copy link

tangjwtj commented Aug 3, 2022

问题描述

针对apache common3的MutablePair类型,fastjson2会序列化出key、value序列化成字段,fastjson1不会.

针对以下对像做序列化:
System.out.println(JSON.toJSONString(new MutablePair<>("aaa","bbb")));

fastjson1 输出为:
{"aaa":"bbb"}

fastjson2输出为:
{"key":"aaa","left":"aaa","right":"bbb","value":"bbb"}

fastjson1的序列化结果是正确的。

注:已经使用最新的snapshot版本测试, 也是同样的输出 ,snapshot版本:fastjson2-2.0.11-20220803.041711-15

环境信息

  • 版本信息:[Fastjson2 2.0.10]
@tangjwtj tangjwtj added the bug Something isn't working label Aug 3, 2022
@wenshao wenshao added this to the 2.0.11 milestone Aug 4, 2022
@wenshao
Copy link
Member

wenshao commented Aug 7, 2022

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

@wenshao wenshao closed this as completed Aug 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants