title: Json parsing and mapping keys
body: <p>I'm trying to map json to send it to another applications which expects the data in it's own formats, I'm using the AWS Lambda which when an event is triggered GETs below json which needs to be parsed and mapped according to what application expects. but the key stack is so large eg "rateCode" in "ratePlan" in "Details", there are almost 20000 rate codes like "abc", "xyz",... it is not a great idea to map like</p>
  
  <pre><code>if "rateCode" == "abc":
      application_two_dict["rate_code"] = 123
  
  </code></pre>
  
  <p>so there are many more keys which keys has large set of values. what is the best way to map those keys. Also this needs to be happened in two way like when we get data from application two we need the parse the json and map the keys other way around which application one understands and vice versa.</p>
  
  <pre><code>
  
  
  {
      "customer": {
          "firstName": "john",
          "lastName": "doe",
          "email": "john.doe@test.com",
          "mailingAddress": {
              "address1": "123 N 1st st",
              "address2": "789",
              "countryCode": "USA",
              "stateCode": "AZ",
              "city": "Phoenix",
              "postalCode": "34567"
          },
          "telephoneNumber": {
              "telephoneNumber": "1235456789"
          }
      },
      "paymentAccount": {
          "firstName": "john",
          "lastName": "doe",
          "paymentAccountType": "VA",
          "expirationDate": "2021-05-31",
          "billingAddress": {
              "address1": "1234 N 1st st",
              "address2": "435",
              "city": "Phoenix",
              "countryCode": "USA",
              "postalCode": "213445",
              "stateCode": "AZ"
          }
      },
      "Details": {
          "123": [{
              "quantity": 1,
              "ratePlan": {
                  "rateCode": "abc",
                  "DetailsList": [{
                      "CategoryCode": "1234",
                  }]
              }
      }
  }
  
  </code></pre>
  
  <p>I still don't have the exact format of app2 json</p>
  
  <p>example json</p>
  
  <p>for example </p>
  
  <p>app1 json</p>
  
  <pre><code>{
   "Details": {
          "123": [{
              "quantity": 1,
              "ratePlan": {
                  "rateCode": "abc",
                  "DetailsList": [{
                      "CategoryCode": "1234",
                  }]
              }
          }
      }   
  }
  </code></pre>
  
  <p>app 2 json</p>
  
  <pre><code>{
      user_details_code : 123,
      quantity : [1],
      rate_plan : {
          rate_code: "xyz",
          category_code : "US_SAN"
      }
  }
  
  </code></pre>