测试JsonAnalyzer解析Json的十一个测试用例
阅读原文时间:2023年07月09日阅读:1

目测以下测试用例都是通过的.

01.

原文={"status":"","message":"success","data":{"title":{"id":"","name":"白菜"},"content":[{"id":"","value":"你好白菜"},{"id":"","value":"你好萝卜"}]}}
分析整形后json文本=
{
"data":{
"content":[
{
"id":"",
"value":"你好白菜"
},
{
"id":"",
"value":"你好萝卜"
}
],
"title":{
"id":"",
"name":"白菜"
}
},
"message":"success",
"status":""
}

02.

原文={"animal":"cat","color":"orange"}
分析整形后json文本=
{
"animal":"cat",
"color":"orange"
}

03.

原文={"name":"Flutty","breed":"Siamese","age":}
分析整形后json文本=
{
"age":,
"breed":"Siamese",
"name":"Flutty"
}

04.

原文={"person":{"name":"LindsayBassett","heightInInches":,"head":{"hair":{"color":"lightblood","length":"short","style":"a-line"},"eyes":"green"}}}
分析整形后json文本=
{
"person":{
"head":{
"eyes":"green",
"hair":{
"color":"lightblood",
"length":"short",
"style":"a-line"
}
},
"heightInInches":,
"name":"LindsayBassett"
}
}

05.

原文={"eggCartoon":["egg","egg","egg","egg","egg","egg","egg",null,"egg",null,"egg",]}
分析整形后json文本=
{
"eggCartoon":[
"egg",
"egg",
"egg",
"egg",
"egg",
"egg",
"egg",
null,
"egg",
null,
"egg"
]
}

06.

原文={"students":["张三","李四","王五","赵六","孙琪","钱吧"]}
分析整形后json文本=
{
"students":[
"张三",
"李四",
"王五",
"赵六",
"孙琪",
"钱吧"
]
}

07.

原文={"scores":[,,,,]}
分析整形后json文本=
{
"scores":[
,
,
,
,

\]  

}

08.

原文={"employees":[{"firstName":"Bill","lastName":"Gates"},{"firstName":"George","lastName":"Bush"},{"firstName":"Thomas","lastName":"Carter"}]}
分析整形后json文本=
{
"employees":[
{
"firstName":"Bill",
"lastName":"Gates"
},
{
"firstName":"George",
"lastName":"Bush"
},
{
"firstName":"Thomas",
"lastName":"Carter"
}
]
}

09.

原文={"name":"username","age":,"admin":true}
分析整形后json文本:=
{
"admin":true,
"age":,
"name":"username"
}

10.

原文={"HeWeather6":[{"basic":{"cid":"CN101010100","location":"北京","parent_city":"北京","admin_area":"北京","cnty":"中国","lat":"39.90498734","lon":"116.40528870","tz":"8.0"},"daily_forecast":[{"cond_code_d":"","cond_code_n":"","cond_txt_d":"晴间多云","cond_txt_n":"多云","date":"2017-10-26","hum":"","pcpn":"0.0","pop":"","pres":"","tmp_max":"","tmp_min":"","uv_index":"","vis":"","wind_deg":"","wind_dir":"无持续风向","wind_sc":"微风","wind_spd":""},{"cond_code_d":"","cond_code_n":"","cond_txt_d":"多云","cond_txt_n":"雾","date":"2017-10-27","hum":"","pcpn":"0.0","pop":"","pres":"","tmp_max":"","tmp_min":"","uv_index":"","vis":"","wind_deg":"","wind_dir":"南风","wind_sc":"微风","wind_spd":""},{"cond_code_d":"","cond_code_n":"","cond_txt_d":"多云","cond_txt_n":"多云","date":"2017-10-28","hum":"","pcpn":"0.0","pop":"","pres":"","tmp_max":"","tmp_min":"","uv_index":"","vis":"","wind_deg":"","wind_dir":"北风","wind_sc":"3-4","wind_spd":""}],"status":"ok","update":{"loc":"2017-10-2623:09","utc":"2017-10-2615:09"}}]}
分析整形后json文本=
{
"HeWeather6":[
{
"basic":{
"admin_area":"北京",
"cid":"CN101010100",
"cnty":"中国",
"lat":"39.90498734",
"location":"北京",
"lon":"116.40528870",
"parent_city":"北京",
"tz":"8.0"
},
"daily_forecast":[
{
"cond_code_d":"",
"cond_code_n":"",
"cond_txt_d":"晴间多云",
"cond_txt_n":"多云",
"date":"2017-10-26",
"hum":"",
"pcpn":"0.0",
"pop":"",
"pres":"",
"tmp_max":"",
"tmp_min":"",
"uv_index":"",
"vis":"",
"wind_deg":"",
"wind_dir":"无持续风向",
"wind_sc":"微风",
"wind_spd":""
},
{
"cond_code_d":"",
"cond_code_n":"",
"cond_txt_d":"多云",
"cond_txt_n":"雾",
"date":"2017-10-27",
"hum":"",
"pcpn":"0.0",
"pop":"",
"pres":"",
"tmp_max":"",
"tmp_min":"",
"uv_index":"",
"vis":"",
"wind_deg":"",
"wind_dir":"南风",
"wind_sc":"微风",
"wind_spd":""
},
{
"cond_code_d":"",
"cond_code_n":"",
"cond_txt_d":"多云",
"cond_txt_n":"多云",
"date":"2017-10-28",
"hum":"",
"pcpn":"0.0",
"pop":"",
"pres":"",
"tmp_max":"",
"tmp_min":"",
"uv_index":"",
"vis":"",
"wind_deg":"",
"wind_dir":"北风",
"wind_sc":"3-4",
"wind_spd":""
}
],
"status":"ok",
"update":{
"loc":"2017-10-2623:09",
"utc":"2017-10-2615:09"
}
}
]
}

11.

原文={"data":[{"deliveryListId":"","shipperCode":"","shortShipperName":"RB","orderNo":"","deliveryOrder":,"receiverName":"吉田XXX","receiverTelNo":"","receiverAddress1":"東京都足立区足立1-1","receiverAddress2":"東京都足立区足立1-2","isCod":true,"billAmount":,"geocodingScore":,"latitudeJP":"56789.33","longitudeJP":"123456.33","latitude":"20180001.22","longitude":"20180001.33","vehicleId":"","orderDetails":[{"trackingNo":"","quantity":,"lapCount":null,"statusCode":null,"statusNameMobile":null},{"trackingNo":"","quantity":,"lapCount":,"statusCode":"","statusNameMobile":"配送準備中"},{"trackingNo":"","quantity":,"lapCount":,"statusCode":"","statusNameMobile":"持出し"},{"trackingNo":"","quantity":,"lapCount":,"statusCode":"","statusNameMobile":"配送準備中"},{"trackingNo":"","quantity":,"lapCount":,"statusCode":"","statusNameMobile":"配送準備中"}]}]}
分析整形后json文本=
{
"data":[
{
"billAmount":,
"deliveryListId":"",
"deliveryOrder":,
"geocodingScore":,
"isCod":true,
"latitude":"20180001.22",
"latitudeJP":"56789.33",
"longitude":"20180001.33",
"longitudeJP":"123456.33",
"orderDetails":[
{
"lapCount":null,
"quantity":,
"statusCode":null,
"statusNameMobile":null,
"trackingNo":""
},
{
"lapCount":,
"quantity":,
"statusCode":"",
"statusNameMobile":"配送準備中",
"trackingNo":""
},
{
"lapCount":,
"quantity":,
"statusCode":"",
"statusNameMobile":"持出し",
"trackingNo":""
},
{
"lapCount":,
"quantity":,
"statusCode":"",
"statusNameMobile":"配送準備中",
"trackingNo":""
},
{
"lapCount":,
"quantity":,
"statusCode":"",
"statusNameMobile":"配送準備中",
"trackingNo":""
}
],
"orderNo":"",
"receiverAddress1":"東京都足立区足立1-1",
"receiverAddress2":"東京都足立区足立1-2",
"receiverName":"吉田XXX",
"receiverTelNo":"",
"shipperCode":"",
"shortShipperName":"RB",
"vehicleId":""
}
]
}

--END 2020年5月18日--

12.

原文={"type":"object","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"age":{"type":"integer"},"club":{"type":"object","properties":{"name":{"type":"string"},"founded":{"type":"integer"}},"required":["name"]}},"required":["first_name","last_name","age","club"]}

整形后文本=
{
"properties":{
"age":{
"type":"integer"
},
"club":{
"properties":{
"founded":{
"type":"integer"
},
"name":{
"type":"string"
}
},
"required":[
"name"
],
"type":"object"
},
"first_name":{
"type":"string"
},
"last_name":{
"type":"string"
}
},
"required":[
"first_name",
"last_name",
"age",
"club"
],
"type":"object"
}

--2020年5月22日--

手机扫一扫

移动阅读更方便

阿里云服务器
腾讯云服务器
七牛云服务器

你可能感兴趣的文章