Example JSON:
{
name: "A",
childNodes: [{
name: "B",
childProps: [{
prop_list: [{
name: "BS1"
}, {
name: "BS2"
}]
}],
childNodes: [{
name: "C",
childProps: [{
prop_list: [{
name: "CS1"
}, {
name: "CS2"
}]
}],
}]
}],
childProps: [{
prop_list: [{
name: "AS1"
}, {
name: "AS2"
}]
}]
}
I want to print output in the following manner.
A, B, BS1
A, B, BS2
A, B, C, CS1
A, B, C, CS2
A, AS1
A, AS2
Basically, I want to print the path to each leaf node. (And I need to get the name property value for each object)