title: Gson deserialize map of objects to map of strings
body: <p>I have a bit of a problem concerning JSON deserialization. Background: The response is coming from a graph database (ArangoDB, so its JavaScript serverside), which I would usually process using JavaScript clientside. This works quite nicely, especially since the JavaScript concept of objects has proven quite useful (for me) when querying graph data. I. e. I can attach edges and nodes in whatever way seems useful for one particular endpoint.</p>
  
  <p>This all works nicely, but I am starting to do some performance testing of the server and have decided to use a simple Java application for that. But since I don't really on strong typing, I'm having trouble getting this to work. Basically what I want is to imitate the JavaScript concept and to deserialize any object into a Map. Then I'd deserialize properties, that are object once again using the same mechanism and properties that are list as a List. This needn't be manifest in the object structure, I'd do that on the fly in temporary variables (clientside performance doesn't matter).</p>
  
  <p>The problem is Gson doesn't deserialize (and I know, it shouldn't), f.e.</p>
  
  <pre><code>{"a": {"b":"c"}}
  </code></pre>
  
  <p>using</p>
  
  <pre><code>private static final Type TYPE = new TypeToken&lt;Map&lt;String, String&gt;&gt;(){}.getType();
  </code></pre>
  
  <p>to the map "a"->"{\"b\":\"c\"}".</p>
  
  <p>Is there any way to Gson to do that or do I have to manually parse the string adding quotation marks and escaping other quotation marks?</p>
  
  <p>I'm really not a fan of RegEx, so any help is appreciated.</p>
  
  <p>Thanks in advance, 
  Jonas</p>