这个名字很垃圾,但这是真的。
我编译项目 - 我得到一个异常
Newtonsoft.Json.JsonSerializationException" в Newtonsoft.Json.dll
Исключение типа "Newtonsoft.Json.JsonSerializationException" возникло в Newtonsoft.Json.dll, но не было обработано в коде пользователя
Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System.Collections.Generic.List`1[vOverlay.Player][]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly.
To fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List<T>) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object.
Path 'user', line 1, position 8
好的,我通过将数组替换List<Player> ply = JsonConvert.DeserializeObject<List<Player>>(json);为List<Player>[] ply = JsonConvert.DeserializeObject<List<Player>[]>(json);. 呃……一切都是例外……
ps:该类Player有一个嵌套类user,因为我将它用于两个功能,api格式变化最小 - 仅添加集合"user"


