Problem with deserializing JSON file.
Hello there
I am trying to deserialize a JSON like the following:
The string here being
{"[982367487645900, 504339357638715104]":["id"]}
Into an Dictionary<List<long>, List<string>>
But newtonsoft.json (Which is what I am using for deserializing the JSON file) says that it cannot convert a string into a collectionThe string here being
"[76561198801345900, 504332241820975104]"
3 Replies
because that key is a string, not an array
pretty sure you can't use an array as a key in json
Ah thank you
If you really, really want
Dictionary<List<long>, List<string>>
, you can make a JsonConverter for it: https://paste.mod.gg/xpdtuesgzdjf/0
Also note that the array is in a string, so it's a string.
It's hard to see without syntax highlighting: