pvdung / quick-json

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

Date json generation use invalid json syntax #8

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. execute this java snippet
Map aMap = new HashMap();
aMap.put("aDate",Calendar.getInstance.getTime());
JsonGeneratorFactory factory=JsonGeneratorFactory.getInstance();
JSONGenerator generator=factory.newJsonGenerator();
String json=generator.generateJson(aMap);
System.out("result: " + json);

What is the expected output? What do you see instead?
>> expected 
result : {"id":"[EMPTY]","AN_Response":"","aDate":"Tue Dec 17 13:56:59 CET 
2013"}
>> I see
[{"id":"[EMPTY]","AN_Response":"","aDate":Tue Dec 17 13:56:59 CET 2013}]
the part
"aDate":Tue Dec 17 13:56:59 CET 2013}
is not json compatible (missing " to enclose the value)

What version of the product are you using? On what operating system?
OS : OpsenSuse Linux 12.3 x86_64
JDK 1.7
Quick-json 1.0.2.3

Please provide any additional information below.

Original issue reported on code.google.com by each.dev...@gmail.com on 17 Dec 2013 at 1:16