Open GoogleCodeExporter opened 9 years ago
I have the same problem - a String will be serialized fine as simple String:
String strJson = JsonWriter.objectToJson("5");
=> "5"
But the json reader can not read this vice versa, it throws an Exception
String strClone = (String) JsonReader.jsonToJava(strJson);
Same Exception when formatting the string with
String strBeauty = JsonWriter.formatJson(strJson);
java.io.IOException: Input is invalid JSON; does not start with '{' or '[', c=34
Last read: "
line: 1, col: 2
at com.cedarsoftware.util.io.JsonReader.error(JsonReader.java:3203)
at com.cedarsoftware.util.io.JsonReader.readJsonObject(JsonReader.java:2213)
at com.cedarsoftware.util.io.JsonReader.readObject(JsonReader.java:1161)
at com.cedarsoftware.util.io.JsonReader.jsonToJava(JsonReader.java:1085)
Thus, we have to make a workaround for serializing/deserializing simple
Strings. We are using json-io 2.6.1. We would be pleased if this could be
fixed! Thanks a lot for this fine piece of work.
Original comment by christia...@gmail.com
on 8 Jul 2014 at 8:41
Original issue reported on code.google.com by
chq...@gmail.com
on 13 Feb 2014 at 10:50