JSON数值元素顺序
用于判断使用Jsonpath语法获取到的用例返回值中数组某元素排序是升序或降序排列。
表示使用Jsonpath语法对数组中某元素顺序进行校验,升序=ascending 降序=descending。如参数列输入$.priceRegionList[*].upperPrice
,值列输入ascending
。则判断upperPrice
值是否是升序排列。
如校验返回值中upperPrice
为升序排列,响应body为:
BODY
"{...}":
"code":200,
"msg":"OK",
"priceRegionList":[
{
"lowerPrice":0.0,
"ration":0.0,
"upperPrice":49.0,
"multiChoose":true,
"class":"com.netease.haitao.search.planner.base.api.entity.PriceRegion"
},
{
"lowerPrice":50.0,
"ration":0.0,
"upperPrice":79.0,
"multiChoose":true,
"class":"com.netease.haitao.search.planner.base.api.entity.PriceRegion"
},
{
"lowerPrice":80.0,
"ration":0.0,
"upperPrice":199.0,
"multiChoose":true,
"class":"com.netease.haitao.search.planner.base.api.entity.PriceRegion"
},
...