title: How to serialize and handle dynamic JSON keys?
body: <p>I have to deal with an API with many nested dynamic JSON keys with a lot of nesting.</p>
  
  <p>My Json Response is like that:</p>
  
  <pre><code>{
  "success": true,
  "data": {
      "infoArr": {
          "868.111": {
              "COURSE_ID": "868.111",
              "COURSE_NAME_PL": "DRILLING EQUIPMENT DESIGN",
              "COURSE_NAME_SL": "تصميم معدات حفر",
              "COURSE_NAME": "DRILLING EQUIPMENT DESIGN",
              "COURSE_CODE": "PE4206",
              "COURSE_CREDITS": "3",
              "REG_CREDITS_COUNT": "3",
              "REQUIREMENT_TYPE_ID": "5",
              "REQUIREMENT_ID": "26.111",
              "REQUIREMENT_TYPE_PL": "Mandatory Degree Requirements",
              "REQUIREMENT_TYPE_SL": "متطلبات الشهادة الإجبارية",
              "REQUIREMENT_TYPE": "Mandatory Degree Requirements",
              "CREDITS_COUNT": "162",
              "REQUIREMENT_PASSED_CREDITS": "127",
              "IS_REQUESTABLE": "Y",
              "STATUS_REASON_PL": "Passed All Conditions",
              "STATUS_REASON_SL": "يمكن تسجيل المقرر",
              "STATUS_REASON": "Passed All Conditions",
              "YEAR_ORDER": "4",
              "SEMESTER_ORDER": "1",
              "PASSED_PREREQUISITES": ",",
              "LAST_REGISTER_SEMESTER_ID": "20171",
              "REGISTER_STATUS": "R",
              "FINISH_STATUS": "F",
              "SUB_TOTAL": "26.5",
              "FINAL_EXAM": "21",
              "FINAL_MARK": "48",
              "LAST_REGISTER_SEMESTER_PL": "First Semester 2017/2018",
              "LAST_REGISTER_SEMESTER_SL": "الفصل الأول  2017/2018",
              "SERIAL": 1
          },
          "871.111": {
              "COURSE_ID": "871.111",
              "COURSE_NAME_PL": "SECONDARY RECOVERY",
              "COURSE_NAME_SL": "الاستخلاص المعزز",
              "COURSE_NAME": "SECONDARY RECOVERY",
              "COURSE_CODE": "PE4209",
              "COURSE_CREDITS": "3",
              "REG_CREDITS_COUNT": "3",
              "REQUIREMENT_TYPE_ID": "5",
              "REQUIREMENT_ID": "26.111",
              "REQUIREMENT_TYPE_PL": "Mandatory Degree Requirements",
              "REQUIREMENT_TYPE_SL": "متطلبات الشهادة الإجبارية",
              "REQUIREMENT_TYPE": "Mandatory Degree Requirements",
              "CREDITS_COUNT": "162",
              "REQUIREMENT_PASSED_CREDITS": "127",
              "IS_REQUESTABLE": "Y",
              "STATUS_REASON_PL": "Passed All Conditions",
              "STATUS_REASON_SL": "يمكن تسجيل المقرر",
              "STATUS_REASON": "Passed All Conditions",
              "YEAR_ORDER": "4",
              "SEMESTER_ORDER": "2",
              "PASSED_PREREQUISITES": ",",
              "LAST_REGISTER_SEMESTER_ID": "20164",
              "REGISTER_STATUS": "E",
              "FINISH_STATUS": "F",
              "SUB_TOTAL": "17",
              "FINAL_EXAM": "12",
              "FINAL_MARK": "29",
              "LAST_REGISTER_SEMESTER_PL": "Complementary Period 2016/2017",
              "LAST_REGISTER_SEMESTER_SL": "الدورة التكميلية  2016/2017",
              "SERIAL": 1
          }
      },
      "requestCourseArr": {
          "868.111": {
              "COURSE_ID": "868.111",
              "COURSE_NAME_PL": "DRILLING EQUIPMENT DESIGN",
              "COURSE_NAME_SL": "تصميم معدات حفر",
              "COURSE_NAME": "DRILLING EQUIPMENT DESIGN",
              "COURSE_CODE": "PE4206",
              "COURSE_CREDITS": "3",
              "REG_CREDITS_COUNT": "3",
              "REQUIREMENT_TYPE_ID": "5",
              "REQUIREMENT_ID": "26.111",
              "REQUIREMENT_TYPE_PL": "Mandatory Degree Requirements",
              "REQUIREMENT_TYPE_SL": "متطلبات الشهادة الإجبارية",
              "REQUIREMENT_TYPE": "Mandatory Degree Requirements",
              "CREDITS_COUNT": "162",
              "REQUIREMENT_PASSED_CREDITS": "127",
              "IS_REQUESTABLE": "Y",
              "STATUS_REASON_PL": "Passed All Conditions",
              "STATUS_REASON_SL": "يمكن تسجيل المقرر",
              "STATUS_REASON": "Passed All Conditions",
              "YEAR_ORDER": "4",
              "SEMESTER_ORDER": "1",
              "PASSED_PREREQUISITES": ",",json
              "LAST_REGISTER_SEMESTER_ID": "20171",
              "REGISTER_STATUS": "R",
              "FINISH_STATUS": "F",
              "SUB_TOTAL": "26.5",
              "FINAL_EXAM": "21",
              "FINAL_MARK": "48",
              "LAST_REGISTER_SEMESTER_PL": "First Semester 2017/2018",
              "LAST_REGISTER_SEMESTER_SL": "الفصل الأول  2017/2018",
              "SERIAL": 1
          },
          "871.111": {
              "COURSE_ID": "871.111",
              "COURSE_NAME_PL": "SECONDARY RECOVERY",
              "COURSE_NAME_SL": "الاستخلاص المعزز",
              "COURSE_NAME": "SECONDARY RECOVERY",
              "COURSE_CODE": "PE4209",
              "COURSE_CREDITS": "3",
              "REG_CREDITS_COUNT": "3",
              "REQUIREMENT_TYPE_ID": "5",
              "REQUIREMENT_ID": "26.111",
              "REQUIREMENT_TYPE_PL": "Mandatory Degree Requirements",
              "REQUIREMENT_TYPE_SL": "متطلبات الشهادة الإجبارية",
              "REQUIREMENT_TYPE": "Mandatory Degree Requirements",
              "CREDITS_COUNT": "162",
              "REQUIREMENT_PASSED_CREDITS": "127",
              "IS_REQUESTABLE": "Y",
              "STATUS_REASON_PL": "Passed All Conditions",
              "STATUS_REASON_SL": "يمكن تسجيل المقرر",
              "STATUS_REASON": "Passed All Conditions",
              "YEAR_ORDER": "4",
              "SEMESTER_ORDER": "2",
              "PASSED_PREREQUISITES": ",",
              "LAST_REGISTER_SEMESTER_ID": "20164",
              "REGISTER_STATUS": "E",
              "FINISH_STATUS": "F",
              "SUB_TOTAL": "17",
              "FINAL_EXAM": "12",
              "FINAL_MARK": "29",
              "LAST_REGISTER_SEMESTER_PL": "Complementary Period 2016/2017",
              "LAST_REGISTER_SEMESTER_SL": "الدورة التكميلية  2016/2017",
              "SERIAL": 1
          }
      },
      "groupCourseArr": {
          "868.111": {
              "T_GROUPS": {
                  "30669": "1 (0/40)",
                  "": ""
              },
              "P_GROUPS": {
                  "30670": "1 (0/20)",
                  "30671": "2 (0/20)",
                  "": ""
              },
              "T_GROUPS_OPTIONS": [],
              "P_GROUPS_OPTIONS": []
          },
          "871.111": {
              "T_GROUPS": {
                  "30672": "1 (0/40)",
                  "": ""
              },
              "P_GROUPS": {
                  "": ""
              },
              "T_GROUPS_OPTIONS": [],
              "P_GROUPS_OPTIONS": []
          }
      }
    }
  }
  </code></pre>
  
  <p>My question is how to deal with this data type since it doesn't have a const SerializedName to serialize it using Gson and generate an appropriate POJO Class for that response.</p>
  
  <p>I'm using Retrofit to handle the network operations.</p>
  
  <p><strong>Edit:</strong> I look for an easier way to do that other than iterate through a series of <code>JsonObjects</code> and <code>Maps of Entry</code> since there are more complicated and nested API requests in the server.</p>