fastJSON icon indicating copy to clipboard operation
fastJSON copied to clipboard

better custom type, fix List & Dictionary deserialization

Open gekailin opened this issue 8 years ago • 2 comments

gekailin avatar Feb 01 '18 12:02 gekailin

Thanks but it will break existing use of RegisterCustomType()

mgholam avatar Feb 01 '18 14:02 mgholam

Hi, I am not sure this is related, but I found that if the custom type contains "Dictionary" in the class name, fastJSON always throws the following when deserialize.

System.InvalidCastException: Unable to cast object of type 'System.Collections.Generic.Dictionary2[System.String,System.Object]' to type 'System.Collections.Generic.List1[System.Object]'. at fastJSON.deserializer.ParseDictionary(Dictionary2 d, Dictionary2 globaltypes, Type type, Object input) at fastJSON.deserializer.ToObject(String json, Type type) at fastJSON.JSON.ToObject(String json, Type type)

ariitx avatar Mar 02 '18 03:03 ariitx