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

[FEATURE]2.0.3版本的JSONObject.parseObject方法在指定了Feature.OrderedField的时候也不能保序 #334

Closed
qsmmeng opened this issue May 24, 2022 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@qsmmeng
Copy link

qsmmeng commented May 24, 2022

测试用例:

    public static void main(String[] args) {

        String a = "{\"resultCode\":\"200013\",\"message\":\"查询成功\",\"data\":{\"clientName\":\"张三\",\"clientId\":\"3002674743\",\"phoneNumber\":\"13412345678\",\"gender\":2,\"age\":59}}";

        JSONObject jsonObject = JSONObject.parseObject(a, Feature.OrderedField);

        System.out.println(jsonObject);

    }

2.0.3版本输出如下:

{"data":{"clientId":"3002674743","phoneNumber":"13412345678","gender":2,"clientName":"张三","age":59},"resultCode":"200013","message":"查询成功"}

1.2.83版本输出如下:

{"resultCode":"200013","message":"查询成功","data":{"clientName":"张三","clientId":"3002674743","phoneNumber":"13412345678","gender":2,"age":59}}

见源issue

@qsmmeng qsmmeng added the bug Something isn't working label May 24, 2022
@wenshao wenshao added this to the 2.0.5 milestone May 27, 2022
@wenshao
Copy link
Member

wenshao commented May 28, 2022

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

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