JSON数值元素顺序

用于判断使用Jsonpath语法获取到的用例返回值中数组某元素排序是升序或降序排列。


表示使用Jsonpath语法对数组中某元素顺序进行校验,升序=ascending 降序=descending。如参数列输入$.data.goodsList[1:].actualCurrentPrice,值列输入ascending。则判断actualCurrentPrice值是否是升序排列。

如校验返回值中actualCurrentPrice为升序排列,响应body为:

BODY
"{...}":
"code":200,
"msg":"OK",
"data":{
"goodsList":[
   {
   "actualCurrentPrice":19,
   "actualStorageStatus":1,
   "brandCountryName":"美国品牌",
   "discountBenefitStr":"4.9折",
   "factoryGoods":false,
   "feedbackRate":"87.5%好评"
   },
   {
   "actualCurrentPrice":29.9,
   "actualStorageStatus":0,
   "brandCountryName":"中国品牌",
   "discountBenefitStr":"4.8折",
   "factoryGoods":true,
   "feedbackRate":"97.5%好评"
   },
  ...
}
Copyright © GoApi 2018 all right reserved,powered by Gitbook该文件修订时间: 2019-02-21 21:07:18

results matching ""

    No results matching ""