discomarathon / google-gson

Automatically exported from code.google.com/p/google-gson
0 stars 0 forks source link

Supporting associations like JS (Map based) is desired #116

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.create something like String s = '{a:[1,2,"b"],c:[3,"5",6]}';
2. gson.fromJson(s, Map.class);
3. you get exception

What is the expected output? What do you see instead?
I expected Map (association) similar I have in JS. However I am forced to 
create a new Java type, like:
static class MyType {
  String[] a, c;}

What version of the product are you using? On what operating system?
version 1.3 on Ubuntu

Please provide any additional information below.

BTW if I have mixed array, why can't I deserialize in Object[] with 
automatic fills of elements as Sting, Integer, Long, OtherObject

Original issue reported on code.google.com by jAddress...@gmail.com on 8 Apr 2009 at 1:11

GoogleCodeExporter commented 9 years ago
Gson does serialize non-parameterized maps and collections, but it doesn't 
allow them for deserialization and 
we have no plans to support it. 

Original comment by inder123 on 29 Sep 2009 at 8:57