Jayway JSONPath

2019-09-14 03:25发布

问题:

I am using a library which in turn is using Jayway JSONPath. I'm properly referencing a jsonpath $.location.city for the following JSON file.

{
  "venue":
  {
    "latitude": "51.0500000",
    "longitude": "3.7166700"
  },
  "location":
  {
    "continent": " EU",
    "country": "BE",
    "city": "Brussels"
 }
}

But I am getting the error "InvalidPathException com.jayway.jsonpath.PathNotFoundException: Missing property in path $['location']for $.location.city". Is there any problem with the JSON path ?

标签: json jsonpath