java icon indicating copy to clipboard operation
java copied to clipboard

Error, Maps cant have keys that aren't strings.

Open OwenCalzadilla opened this issue 7 years ago • 0 comments

When trying to convert to JSON a map with a key different than String it will give an error. The example below doesn't work.

Map<Integer,String> map = new HashMap<Integer, String>();
map.put(3, "hello world");
String aux = JsonStream.serialize(map);

OwenCalzadilla avatar Jul 31 '18 13:07 OwenCalzadilla