title: Retrofit does not parse the data when I get response from the server
body: <p>This is the class of data in the network response, when I use the first one, it works properly but when I want to parse it like in the second example, respond fails.</p>
  <p>This is the network response body:</p>
  <pre><code>{&quot;result&quot;:0,&quot;comment&quot;:&quot;Gösterim başarılı.&quot;,&quot;time&quot;:&quot;0.76198577880859 ms&quot;,&quot;header&quot;:&quot;{\&quot;nickname\&quot;:\&quot;N\&quot;,\&quot;profilephoto\&quot;:0,\&quot;totalTests\&quot;:0,\&quot;totalChallenges\&quot;:0,\&quot;totalpoints\&quot;:0,\&quot;socialearned\&quot;:0}&quot;,&quot;tests&quot;:&quot;[]&quot;,&quot;entries&quot;:&quot;[]&quot;}
  </code></pre>
  <p>Code:</p>
  <pre><code>//works but I do not want it
  public class ProfileData {
  @SerializedName(&quot;result&quot;)
  private int result;
  
  @SerializedName(&quot;comment&quot;)
  private String comment;
  
  @SerializedName(&quot;time&quot;)
  private String time;
  
  @SerializedName(&quot;header&quot;)
  private String header;
  
  @SerializedName(&quot;tests&quot;)
  private String tests;
  
  @SerializedName(&quot;entries&quot;)
  private String entries; 
  //getters
  }
  
  //does not work, reponse fails
  public class ProfileData {
  @SerializedName(&quot;result&quot;)
  private int result;
  
  @SerializedName(&quot;comment&quot;)
  private String comment;
  
  @SerializedName(&quot;time&quot;)
  private String time;
  
  @SerializedName(&quot;header&quot;)
  private Header header;
  
  @SerializedName(&quot;tests&quot;)
  private List&lt;Test&gt; tests;
  
  @SerializedName(&quot;entries&quot;)
  private List&lt;Entry&gt; entries;
  }
  </code></pre>
  <p>this one fails.
  Here are my data model class'</p>
  <pre><code> public class Header {
  //member variables
  @SerializedName(&quot;nickname&quot;)
  private String nickName;
  
  @SerializedName(&quot;profilephoto&quot;)
  private int profilePhoto;
  
  @SerializedName(&quot;totalTests&quot;)
  private int totalTests;
  
  @SerializedName(&quot;totalChallenges&quot;)
  private int totalChallenges;
  
  @SerializedName(&quot;totalpoints&quot;)
  private int totalPoints;
  
  @SerializedName(&quot;socialearned&quot;)
  private int socialEarned;
  }
  
  public class Test {
  //member variables
  @SerializedName(&quot;date&quot;)
  private String date;
  
  @SerializedName(&quot;lessonNo&quot;)
  private int lessonNo;
  
  @SerializedName(&quot;testNo&quot;)
  private int testNo;
  
  @SerializedName(&quot;correct&quot;)
  private int correctAnswers;
  
  @SerializedName(&quot;wrong&quot;)
  private int wrongAnswers;}
  
  public class Entry {
  //member variables
  @SerializedName(&quot;subjectID&quot;)
  private int subjectID;
  
  @SerializedName(&quot;commentID&quot;)
  private int commentID;
  
  @SerializedName(&quot;comment&quot;)
  private String comment;
  
  @SerializedName(&quot;dateTS&quot;)
  private String dateTime;
  
  @SerializedName(&quot;usercode&quot;)
  private int userCode;
  
  @SerializedName(&quot;nickname&quot;)
  private String nickName;
  
  @SerializedName(&quot;likepoint&quot;)
  private int likePoint;
  
  @SerializedName(&quot;dislikepoint&quot;)
  private int dislikePoint;}
  
  public interface ProfileApiInterface {
  static final String USER_CODE_FIELD=&quot;usercode&quot;;
  static final String PROFILE_PHP=&quot;%5bF%5dshowProfile.php&quot;;
  
  @FormUrlEncoded
  @POST(PROFILE_PHP)
  Call&lt;ProfileData&gt; postProfileData(@Field(USER_CODE_FIELD) Integer userCode);
  }
  
  public class ApiClient {
  private static final String LOGIN_URL=&quot;someurl&quot;;
  private static Retrofit retrofit=null;
  
  public static Retrofit getInstance(){
      if(retrofit==null){
          //Http logging interceptor
          HttpLoggingInterceptor httpLoggingInterceptor = new HttpLoggingInterceptor();
          httpLoggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
  
          OkHttpClient okHttpClient=new OkHttpClient.Builder()
                  .addInterceptor(httpLoggingInterceptor)
                  .build();
  
          Gson gson=new GsonBuilder().setLenient().create();
          retrofit=new Retrofit.Builder()
                  .baseUrl(LOGIN_URL)
                  .addConverterFactory(GsonConverterFactory.create(gson))
                  .client(okHttpClient)
                  .build();
      }
      return retrofit;
  }
  }
  </code></pre>
  <p>What am I doing wrong, I cannot understand. All I want is to parse the json object into my Java objects.</p>