© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
189 replies
BigggMoustache

I can't JSON to List ;_; [Answered]

The JSON value could not be converted to System.Collections.Generic.List`1[Card]. Path: $ | LineNumber: 0 | BytePositionInLine: 1.'
The JSON value could not be converted to System.Collections.Generic.List`1[Card]. Path: $ | LineNumber: 0 | BytePositionInLine: 1.'

That's my error

Here's my attempt to just call and dump it into a List.
        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);
        }
        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);
        }
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements
Next page

Similar Threads

❔ ✅ I can't convert List<BaseClass> to List<T> where T: BaseClass.
C#CC# / help
4y ago
how to add to list [Answered]
C#CC# / help
4y ago