title: How to convert json objects with number as field key in Java?
body: <p>The server I am working with returns an json object which contains a list of objects, not just one.</p>
  
  <pre><code>{
  "1":{"id":"1","value":"something"},
  "2":{"id":"2","value":"some other thing"}
  }
  </code></pre>
  
  <p>I want to convert this json object into an object array.</p>
  
  <p>I know I can use Gson, and create a class like this:</p>
  
  <pre><code>public class Data {
      int id;
      String value;
  }
  </code></pre>
  
  <p>and then use</p>
  
  <pre><code>Data data = new Gson().fromJson(response, Data.class);
  </code></pre>
  
  <p>But it's only for the objects inside the json object.
  <strong>I don't know how to convert json object with number as keys.</strong></p>
  
  <p>Or alternatively I need to alter the server to response to something like this?:</p>
  
  <pre><code>{["id":"1","value":"something"],["id":"2","value":"some other thing"]}
  </code></pre>
  
  <p>But I don't want to change to server as I have to change all the client side codes.</p>