Pre Exam Test Practice (SSC | Banking | IAS | GATE | State Level | CLAT | Railways | Insurance | Teaching Exams | NDA | Defence | IES |State Exam )

Organizational Research By

Surprising Reserch Topic

get nested json object with gson using retrofit


get nested json object with gson using retrofit  using -'java,android,json,gson,retrofit'

I'm consuming an API from my android app, and all the JSON responses are like this:

{
    'status': 'OK',
    'reason': 'Everything was fine',
    'content': {
         < some data here >
}


The problem is that all my POJOs have a status, reason fields, and inside the content field is the real POJO I want.

Is there any way to create a custom converter of Gson to extract always the content field, so retrofit returns the appropiate POJO?
    

asked Oct 23, 2015 by deven.bendale
0 votes
14 views



Related Hot Questions



Government Jobs Opening


...