help
Root Question Message
The JSON value could not be converted to System.Collections.Generic.List`1[Card]. Path: $ | LineNumber: 0 | BytePositionInLine: 1.'
private static async Task ProcessRepositories()
{
var stringTask = client.GetStringAsync("https://api.magicthegathering.io/v1/cards/");
var msg = await stringTask;
var cards = JsonSerializer.Deserialize<List<Card>>(msg);
}
{"cards":[{"name":"Ancestor's**
so I see where my issue is, but I don't know how to address it.<List<Card>
is not the same as a {"cards": arrayOfCards
"cards"
in the json, with my existing Cards
class inside of it. I'm going to try that.{"cards":[{"name":"Ancestor's
here indicates there is an object above the actual card when returning multiple correct? I don't know what it looks like when returning 1 card aloneSystem.Text.Json.JsonException: 'The JSON value could not be converted to System.Collections.Generic.List`1[Rootobject]. Path: $ | LineNumber: 0 | BytePositionInLine: 1.'
Card
as array in my previous class{"cards": oneCardInArray
Deserialize<List<Object>
[{"Name":"Card 0"},{"Name":"Card 1"},{"Name":"Card 2"},{"Name":"Card 3"},{"Name":"Card 4"},{"Name":"Card 5"},{"Name":"Card 6"},{"Name":"Card 7"},{"Name":"Card 8"},{"Name":"Card 9"}]