有一些JSON:
{
metadata:{
result_count: 3,
},
search_results: [
{...},
{...},
{...}
]
}
做的时候
.setHeader("result_count").jsonpath("$.metadata.result_count")
.setHeader("result").jsonpath("$.search_results[0]")
获得
Caused by: com.jayway.jsonpath.PathNotFoundException: Property ['search_results'] not found in path $
更改订单时:
.setHeader("result").jsonpath("$.search_results[0]")
.setHeader("result_count").jsonpath("$.metadata.result_count")
获得
Caused by: com.jayway.jsonpath.PathNotFoundException: Property ['metadata'] not found in path $
如何解决?