空手道比赛引发com.intuit.karate.exception.KarateException错误:字符“。”在位置3上无效

时间:2019-01-03 17:34:41

标签: karate

我正在尝试在tis json数组上执行匹配。场景是这样的

    Scenario : match lob
    * def op = 
    """
    [
     {
      "_id": "1",
      "_class": 
          "com.xxx.versionone.tir.enterprise.persistence.model.xxx",
      "lobName": "abc",
      "changeDate": "2016-11-04T11:41:40",
      "changedBy": "abc",
      "createdDate": "2014-07-01T11:47:23",
      "lastSdpPublishDate": "2018-10-31T00:00:00"
  },
  {
    "_id": {
           "$oid": "57883a41e4b076d23a82e9e7"
           },
     "_class": 
  "com.xxx.versionone.tir.enterprise.persistence.model.xxx",
    "lobName": "asda",
    "changeDate": "2016-07-14T21:20:54",
     "changedBy": "TXA858",
     "createdDate": "2016-07-14T21:20:01",
     "createdBy": "TXA858",
     "lastSdpPublishDate": "2018-10-31T00:00:00"
     }
    ]
"""
* match $op...lobName contains ["abc"]

我收到此错误: com.intuit.karate.exception.KarateException:字符“。”位置3上的无效。 在com.intuit.karate.StepDefs.matchNamed(StepDefs.java:540)   在com.intuit.karate.StepDefs.matchContains(StepDefs.java:532)

1 个答案:

答案 0 :(得分:1)

JSON路径深度扫描为.. 不是 ...

这应该有效,

* match $op..lobName contains ["abc"]

Json path operators