2

我得到了以下 JSON

   {
   "response":{
      "id":"XYZ",
      "header":[
         {
            "nat":"1"
         }
      ],
      "summary":[
         {
            "recordCreationDate":"29-Aug-2018",
            "verificationTypeDescription":"Verified",
            "birthDate":"01-Feb-1981",
            "sex":"F",
            "title":"MRS",
            "forename":"TEST",
            "surname":"TEST"
         }
      ]
   }
}

我想获取任何字段的值,例如birthDate,不提供完整路径。阅读这个不错的教程https://www.james-willett.com/rest-assured-gpath-json,我设法写了这个 - 不工作 - 代码:

response.jsonPath().get("$.'**'.find(){node -> node.name() == 'birthDate'}");

我错过了什么?

4

0 回答 0