Test json property exists

30 views
Skip to first unread message

Marc Jacobi

unread,
Jun 14, 2021, 7:52:45 AM6/14/21
to dotliquid
I am looking for a way to check if a json property exists. As an alternative I could also work with a list of key-value pairs of a json object.

"items" : [
  "item" : {
    "prop1": "foo",
    "prop2": "bar"
  },
  "item" : {
    "prop1": "foo",
    "prop2": "bar",
    "prop3": "foobar"
  }
  "item" : {
    "prop1": "foo"
  }
]

I need to be able to process the 'item' objects and conditionally output based on the existence of a 'prop' field...
Reply all
Reply to author
Forward
0 new messages