title: Android Studio okhttp3 response with empty arraylist
body: <p>I am successfully using okhttp to GET a json from an API.  However the response is supposed to give me 4 things: status, links, schema, and a array (or arraylist) called "items"  Here's part of the sample response where I cut off for repetition:</p>
  
  <pre><code>{
    "status": 200,
    "links": {
      "self": "http://localhost:64930/v1/suggestions?q=wei&amp;fq=types:(HWCV_10002,HWCV_10000)"
    },
    "schema": "http://localhost:64930/v1/spec/schema.healthwise.api.items.json",
    "items": [
      {
        "id": "HWCV_04520",
        "label": "Weight Loss Medicines",
        "types": [
          {
            "id": "HWCV_10002",
            "label": "Treatment"
          }
        ]
      },
      {
        "id": "HWCV_22136",
        "label": "Weight Loss (Bariatric) Surgery",
        "types": [
          {
            "id": "HWCV_10002",
            "label": "Treatment"
          }
        ]
      }, etc, etc.
  </code></pre>
  
  <p>Now here's the response I get after converting it to a string:</p>
  
  <pre><code>{"status":200, "links":{"self":"https://search.healthwise.net/v1/suggestions?q=wei\u0026fq=types:HWCV_10002,HWCV_10000)"},"schema":"https://search.healthwise.net/v1/spec/schema.healthwise.api.items.json","items":[]}
  </code></pre>
  
  <p>My question is: How do I find (and list) the "items" array?  Or is it really empty because when I use android studio debugger to look at the jsonobject (after making the response a string and then loading it into a jsonobject) the array ([]) or whatever is empty:</p>
  
  <pre><code>0 = {LinkedHashMap$LinkedEntry@4317} "status" -&gt; "200"
  
  1 = {LinkedHashMap$LinkedEntry@4318} "links" -&gt; "{"self":"https:\/\/search.healthwise.net\/v1\/suggestions?q=wei&amp;fq=types:(HWCV_10002,HWCV_10000)"}"
  
  2 = {LinkedHashMap$LinkedEntry@4319} "schema" -&gt; "https://search.healthwise.net/v1/spec/schema.healthwise.api.items.json"
  
  3 = {LinkedHashMap$LinkedEntry@4320} "items" -&gt; "[]"
   key = "items"
   value = {JSONArray@4328} "[]"
    values = {ArrayList@4333}  size = 0
  </code></pre>
  
  <p>BTW here's the code:</p>
  
  <pre><code>try {
          Response response = client.newCall(newRequest).execute();
          String jsonData = response.body().string();
          JSONObject jobject = new JSONObject(jsonData);
          final String str = jobject.getString("items");
          JSONArray jsonArray = jobject.getJSONArray("items");
          Log.d("OKHTTP3", "Got the response");
  
  
          } catch (IOException e) {
              Log.d("OKHTTP3", "Exception while doing request");
              e.printStackTrace();
          }
  </code></pre>