Here is a JSON object that I need to iterate through in order to generate all possible nested group names:
{
"groups": [
{
"group": "group1",
"childrens": [
{
"group": "group1_1",
"childrens": []
},
{
"group": "group1_2",
"childrens": [
{
"group": "group1_2_1",
"childrens": []
},
{
"group": "group1_2_2",
"childrens": []
},
{
"group": "group1_2_3",
"childrens": []
}
]
},
{
"group": "group1_3",
"childrens": []
},
{
"group": "group1_4",
"childrens": []
}
]
},
{
"group": "group2",
"childrens": [
{
"group": "group2_1",
"childrens": []
},
{
"group": "group2_2",
"childrens": []
}
]
}
]
}
Q) how to genarete the below list from above JSON
group1
group1/group1_1
group1/group1_2
group1/group1_2/group1_2_1
group1/group1_2/group1_2_2
group1/group1_2/group1_2_3
group1/group1_3
group1/group1_4
group2
group2/group2_1
group2/group2_2
The provided JSON object needs to be iterated through to obtain all possible nested group names.