9
String json = """
{
"head": {
"requestTime": "1654070371884",
"merchantcode": "111",
"ticket": "111",
"version": "1.0.0"
},
"body": {
"phone": "111",
"type": "1",
"ticket": ""
},
"sign": "111"
}
""";
System.out.println(JSON.parseObject(json, Feature.OrderedField));
输出为
{
"head": {
"requestTime": "1654070371884",
"merchantcode": "111",
"ticket": "111",
"version": "1.0.0"
},
"sign": "111",
"body": {
"phone": "111",
"type": "1",
"ticket": ""
}
}
期望顺序不改变,但实际结果是顺序发生了改变。1.2.60 版本不存在此问题