title: 'JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated object at line 1 column 30'
body: <p>I have an API response as below:</p>
  
  <pre><code>[
  {
      "id": "123",
      "date": "2016-12-11T12:23:34Z",
      "description": "A bag of spanners",
      "amount": "35.25",
      "currency": "GBP"
  },
  {
      "id": "124",
      "date": "2016-12-12T01:58:59Z",
      "description": "Hot chocholate",
      "amount": "12.50",
      "currency": "GBP"
  },
  {
      "id": "125",
      "date": "2016-12-12T06:11:06Z",
      "description": "Subscriptions - Magazine",
      "amount": "5.99",
      "currency": "GBP"
  },
  {
      "id": "126",
      "date": "2016-12-13T10:03:17Z",
      "description": "Movie rental",
      "amount": "3.99",
      "currency": "GBP"
  }]
  </code></pre>
  
  <p>I tried parsing it using java as follows:</p>
  
  <pre><code>            Object object = (Object) HttpRequest.getInputStreamFromUrl(ApiUtils.getTransactionsUrl(), Object.class, mContext);
              Type typeMyType = new TypeToken&lt;ArrayList&lt;Transaction&gt;&gt;(){}.getType();
              Gson gson = new Gson();
              transactionList = gson.fromJson(object.toString(), typeMyType);
  </code></pre>
  
  <p>I'm getting <code>'JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated object at line 1 column 30'</code></p>
  
  <p>I also tried some other approaches which caused <code>com.google.gson.internal.LinkedTreeMap cannot be cast to org.json.JSONObject</code></p>
  
  <p>How to parse this type of JSON object?</p>