Did some reading on JSONpath yesterday. On top of ...
# singer-tap-development
v
Did some reading on JSONpath yesterday. On top of the (dot)
.
notation. You can use single / double quotes just like with dicts in python. So if you had a json object that looks like https://jsonpath.com/ is a great place to test
Copy code
{
  "firstName": "John",
  "lastName": "doe",
  "age": 26,
  "address": {
    "streetAddress": "naist street",
    "city": "Nara",
    "postalCode": "630-0192"
  },
  "phoneNumbers": [
    {
      "type": "iPhone",
      "number": "<tel:0123-4567-8888|0123-4567-8888>"
    },
    {
      "type": "home",
      "number": "<tel:0123-4567-8910|0123-4567-8910>"
    }
  ]
}
You could list all phone numbers by going
$.phoneNumbers[*]
, or you could write
$['phoneNumbers'][*]
I find the second one easier to read but that's probably just me 🤷