You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
1. putting a Date-object into a JSONObject
What is the expected output? What do you see instead?
I expected a String representation of that Date, but I get it without
quotes, so the JSON is not valid.
What version of the product are you using? On what operating system?
version 1.1 of json-simple
To fix it, I have to "convert" the date by toString().
Original issue reported on code.google.com by dief...@gmail.com on 20 Apr 2009 at 1:33
The text was updated successfully, but these errors were encountered:
Here's the mapping between JSON and Java entities:
http://code.google.com/p/json-simple/wiki/MappingBetweenJSONAndJavaEntities
Basically, you need to follow the mapping to get valid JSON strings.
Original comment by fangyid...@gmail.com on 20 Apr 2009 at 1:45
I disagree with the current behaviour. The library should either automatically
quote
what toString() returns or not accept unrecognized objects at all. Silently
producing
broken JSON is the worst option of all IMHO.
Original comment by martin.p...@gmail.com on 10 Aug 2009 at 1:34
writeJSONString(Object) writing an unquoted toString() is a disaster. I agree
with martin, silently producing broken JSON is the worst option, and the
default behavior.
Original comment by ober...@civicscience.com on 4 Mar 2014 at 6:30
Original issue reported on code.google.com by
dief...@gmail.com
on 20 Apr 2009 at 1:33The text was updated successfully, but these errors were encountered: