title: How to replace values in a nested dict
body: <p>I have to different nested dict and I want to replace some keys in dict A with corresponding values in dict B
  Here is dict A </p>
  
  <pre><code>{
    "Animals": {
      "catgry": {
        "1": "Dogs",
        "2": "Cats",
        "3": "Birds",
      }
    },
    "dogBreeds": {
      "catgry": {
        "1": "Belgian Malinois",
        "2": "Australian Bulledog",
        "3": "Cane Corso",
        "4": "Chow chow",
        "5": "Dalmatian",
        "6": "Dobermann",
        "7": "Labrador",
        "8": "Rottweiler"
      }
    }
  }
  </code></pre>
  
  <p>and the dict B is</p>
  
  <pre><code>{
    "name": "MyGarden",
    "children": [
      {
        "name": "Animals",
        "Animals":"1",
        "children": [
          {
            "name": "dogBreeds",
            "dogBreeds":"1",
            "children": [
              {
                "name": "myBelgian malinois",
                "weight": "30"
              }
            ]
          },
          {
            "name": "dogBreeds",
            "dogBreeds":"2",
            "children": [
              {
                "name": "myAustralian Bulledog",
                "weight": "35"
              }
            ]
          }
        ]
      }
    ]
  }
  </code></pre>
  
  <p>I tried first to remove the key 'catgry' from dict A  and then replace the values with the corresponding key but didn't succeed without deleting the children also</p>
  
  <p>[EDIT]
  Here is the expected result</p>
  
  <pre><code>{
    "name": "MyGarden",
    "children": [
      {
        "Animals":"Dogs",
        "children": [
          {
            "dogBreeds":"Belgian Malinois",
            "children": [
              {
                "name": "myBelgian malinois",
                "weight": "30"
              }
            ]
          },
          {
            "dogBreeds":"Australian Bulledog",
            "children": [
              {
                "name": "myAustralian Bulledog",
                "weight": "35"
              }
            ]
          }
        ]
      }
    ]
  }
  </code></pre>