I am trying to use JSONPath expression to extract 2 arrays and concatenate them today to form a long array - and ideally making them unique. However, no syntax I use in the online playground produces results. Ultimately I will want to use this in a Jenkins job. So, it has to be operational with the Java implementation
Here is my json
{
"commits": [
{
"author": {
"name": "Christian",
"email": "christian@company.com"
},
"added": [
"deleteme/main.tf"
],
"modified": [
],
"removed": [
"deleteme.txt"
]
}
]
}
And here is my expression (which I am trying to evaluate here):
$.append($.commits[*].added[*], $.commits[*].removed[*])
Which I would love to see as
["deleteme/main.tf", "deleteme.txt"]
Or better still:
"deleteme/main.tf, deleteme.txt"
because ultimately I need a comma separated set of values
Oh yeah: Bonus for only unique results