by homedog · 13y ago · 0 comments
I do look forward to the JSON community (re?)developing schema and transformation languages to go along with this.
if(((json.author || {}).lastPublish || {}).publishDate)) {
do something
}
It can be replaced with: if(jsonPath(json, "$.author.lastPublish .publishDate")) {
do something
}
Or better, get all book publish dates, regardless of number of books, if any even exist, and those that might have a missing publishDate: publishDates = jsonPath(json,"$.author.books[*].publishDate");