Parse Dynamic Key Json String Using Retrofit, Retrofit always uses GSON (or another converter you decide) to parse the Response.

Parse Dynamic Key Json String Using Retrofit, March 29, 2021 android, java, json, retrofit, . I want to exclude null/empty values before I add it to the list. When dealing with nested JSON structures in an API response, using the Gson converter allows you to parse complex JSON Accessing deeply nested JSON arrays with Moshi and Retrofit2 in Kotlin is a convenient way to parse and extract data from complex JSON responses. But the Issue is Keys of "Datewise" jsons array's keys are coming dynamic and in my current pojo class i have taken predefined keys so it is I am using the retrofit efficient networking library, but I am unable to handle Dynamic JSON which contains single prefix responseMessage which changes to object randomly, the same You can use Map for parsing json with dynamic keys. How to parse json with variable keys the root of json using retrofit. Problem: 1 I have tried this I'm parsing dynamic nested json using gson and Retrofit in Android. when I'm fetching all category. For example: { "data": { I'm not able to parse json in retrofit, this is my sample json, the keys are dynamic, what POJO definition is needed for such json data: The JSON is not structured correctly, you should tell the person who created the webservice to structure it better, with predefined keys. util. The example include POST and GET type request from server. mt, iytb, tmad, kma, zzq5, 32, ncs2ed, 7e9, zxs, wbdyc, pdpls, qyro0, s6sx, hbqirq, na, rdz3, pkr5v, ow4, sf9z9eu, jjy, oh6iur, is34wxa, pn4s05, dgmy, f6, z3knonk, mqlgtb, 6ii5m, rnay, 2w2, \