如何让fastjson2的PrettyFormat输出达到fastjson之前一样的效果?
FastJson2中格式化输出样式
JSON.toJSONString(jsonObject, JSONWriter.Feature.PrettyFormat)
{
"type":1001,
"job_id":[
0,
45732
],
"id":[
1297059520,
4117498193
],
"is_client":false,
"stream_count":0
}
FastJson中格式化输出样式
JSON.toJSONString(jsonObject, Boolean.TRUE)
{
"type":1001,
"stream_count":0,
"job_id":[0,45732],
"id":[1297059520,4117498193],
"is_client":false
}
- 我该如何在fastjson2中做到fastjson之前的输出样式,不想让Json中数组的val展开换行
因为项目有解析前后对比换行后样式错乱