Can someone help me how to convert such a structure of dicts:
{
"de": {
"test.de": {
"matija.test.de": {
"matija": {
"id": 8457717,
"absolute_name": "matija.matija.test.de"
}
}
}
},
"com_test": {
"aa.com_test": {
"matija": {
"id": 8457719,
"absolute_name": "matija.aa.com_test"
}
},
"demo1.com_test": {
"tre.demo1.com_test": {
"matija": {
"id": 8457722,
"absolute_name": "matija.tre.demo1.com_test"
}
}
},
"matija": {
"id": 8457723,
"absolute_name": "matija.com_test"
}
},
}
INTO
[
{
"de": {
"children": [
{
"test.de": {
"children": [
{
"matija.test.de": {
"children": [
{
"id": 8457717,
"absolute_name": "matija.matija.test.de",
"children": []
}
]
}
}
]
}
}
]
}
},
...
]
I do not know how nested this hash map should look, but most nested objects need a “children” attribute equal to an empty list. All others above them need to have the “children” attribute populated like the above code.