sgzwiz / jsonplugin

Automatically exported from code.google.com/p/jsonplugin
0 stars 1 forks source link

JSON object names without quotes #97

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Serialize a java.util.Map with numbers as keys, e.g. {1: "number one"}

What is the expected output? What do you see instead?
The expected output is {"1": "number one"}
The actual output is {1: "number one"}

According to the JSON specification object property names are always
strings, thus surrounded by quotes.

What version of the product are you using? On what operating system?
jsonplugin 0.32

Please provide any additional information below.
I think this has been fixed for 0.34 but I think the fix simply forbids
non-string keys. This should be relaxed to forbid complex types but allow
things like numbers, booleans, etc.
I've got a working fix for the 0.32 version.
I use jsonplugin  0.32 since due to some Struts 2.1.6 bugs I must use 2.0.x

Original issue reported on code.google.com by migueldi...@gmail.com on 14 Aug 2009 at 9:55