title: OnFailure() methods throws Exception Expected BEGIN_ARRAY but was STRING at line 1 column 1 path $
body: <p>onFailure in retrofit is throwing this exception "Expected BEGIN_ARRAY but was STRING at line 1 column 1 path $" also if i remove setLinient(true) from gson converter the same line 1 coloumn 1 throws one more exception "Malformed json" and this happened all of a sudden previously it was working fine,i'm having a real hard time analyzing what has changed that led to this problem,can someone please have a look at this and help me out,</p>
  
  <p>I have this Json Response coming from server:</p>
  
  <pre><code>[{
      "disposal_type_category": {
          "category_entry_total": "21"
      },
      "disposal_types": [{
              "ID": "78",
              "entries": [{
                      "ID": 2584,
                      "entry_tally": "1"
                  },
                  {
                      "ID": 2578,
                      "entry_tally": "1"
                  }
              ]
          },
          {
              "ID": "1323",
              "entries": [{
                      "ID": 2583,
                      "entry_tally": "1"
                  },
                  {
                      "ID": 2579,
                      "entry_tally": "1"
                  }
              ]
          }
      ]
  },
  {
      "disposal_type_category": {
          "category_entry_total": "25.2"
      },
      "disposal_types": [{
              "ID": "80",
              "entries": [{
                      "ID": 2583,
                      "entry_tally": "1"
                  },
                  {
                      "ID": 2579,
                      "entry_tally": "1"
                  }
  
              ]
          },
          {
              "ID": "84",
              "entries": [{
                      "ID": 2583,
                      "entry_tally": "1"
                  },
                  {
                      "ID": 2579,
                      "entry_tally": "1"
                  }
  
              ]
          }
      ]
  }]
  </code></pre>
  
  <p>This is my retrofit code:</p>
  
  <pre><code>ApiInterface apiService =
              ApiClient.getClient().create(ApiInterface.class);
      String token = prefs.getString("token", "No name defined");//"No name defined" is the default value.
  
      Call&lt;List&lt;Disposal&gt;&gt; callm = apiService.getCollection(token);
      callm.enqueue(new Callback&lt;List&lt;Disposal&gt;&gt;() {
          @Override
          public void onResponse(Call&lt;List&lt;Disposal&gt;&gt; call, Response&lt;List&lt;Disposal&gt;&gt; response) {
              if (response.body() != null) {
                  EntriesList = response.body();
                  setRecyclerData(0);
              }
          }
  
          @Override
          public void onFailure(Call&lt;List&lt;Disposal&gt;&gt; call, Throwable t) {
  
          }
      });
  </code></pre>
  
  <p>This is in my ApiClient.java:</p>
  
  <pre><code>public static Retrofit getClient() {
      if (retrofit==null) {
          Gson gson = new GsonBuilder().setLenient().create();
          retrofit = new Retrofit.Builder()
                  .baseUrl(BASE_URL)
                  .addConverterFactory(ScalarsConverterFactory.create())
                  .addConverterFactory(GsonConverterFactory.create(gson))
                  .build();
      }
      return retrofit;
  }
  </code></pre>
  
  <p>This is in ApiInterface.java:</p>
  
  <pre><code>Call&lt;List&lt;Disposal&gt;&gt; getCollection(@Header("Authorization") String token);
  </code></pre>
  
  <p>Disposal.java:</p>
  
  <pre><code>public class Disposal {
      @SerializedName("disposal_type_category")
      @Expose
      public DisposalTypeCategory disposalTypeCategory;
      @SerializedName("disposal_types")
      @Expose
      public List&lt;DisposalType&gt; disposalTypes = null;
  }
  </code></pre>
  
  <p>DisposalTypeCategory.java:</p>
  
  <pre><code>public class DisposalTypeCategory { 
      @serializedname("category_entry_total")
      @expose 
      public String categoryEntryTotal;
  }
  </code></pre>
  
  <p>DisposalType.java:</p>
  
  <pre><code>public class DisposalType {
      @serializedname("ID")
      @expose 
      public String iD; 
      @serializedname("entries")
      @expose 
      public List&lt;Entries&gt; entries = null;
  }
  </code></pre>
  
  <p>Entries.java:</p>
  
  <pre><code>public class Entries {
      @serializedname("ID") 
      @expose 
      private int iD;
      @SerializedName("entry_tally")
      @Expose
      private String entryTally;
  }
  </code></pre>
  
  <p>I have set setLineant(true) for Gson because if i remove it i will get malformed json exception, even this issue started recently previously was fine, not sure if its related.
  The issue started after 2-3 new fields were added to API and the base url was changed but still the core remains same.</p>