I have a dict with a key slug
and I want to put all key/value pairs in the dict into a child dict with the name taken from the slug
.
For example, given this input:
{
"tasks": {},
"task_defaults": {
"retry": {
"count": 3,
"delay": 2
}
},
"slug": "test"
}
I want this output:
{
"test": {
"tasks": {},
"task_defaults": {
"retry": {
"count": 3,
"delay": 2
}
}
}
}
How can I achieve this?