PokemonTCG/pokemon-tcg-sdk-csharp

JSON Serialization Error when Filter is Only Pokémon Name

Closed this issue · 8 comments

When I try to get a card using GetApiResourceAsync<PokemonCard>(filter); and my filter is PokemonFilterBuilder.CreatePokemonFilter().AddName('charizard'); I get the following error:

Newtonsoft.Json.JsonSerializationException: 'Error converting value {null} to type 'System.Double'. Path 'data[61].tcgplayer.prices.reverseHolofoil.market', line 1, position 122786.'

I am getting this exact same error. It's weird because it worked for me last night, but this morning it is not working. Maybe a caching issue?

I will look to get fix out over the weekend

It seems like the nuget package is the issue since bypassing it seems to resolve the issue. Does it need to be rebuilt and deployed maybe?

@rarDevelopment I think @ahostetter is correct.

I have just added a new unit test to the codebase:

       [Test]
        public async Task GetPokemonByName_ExtensionFilters_ApiResourceAsync()
        {
            // assemble
            var httpclient = new HttpClient();
            var pokeClient = new PokemonApiClient(httpclient);

            var filter = PokemonFilterBuilder.CreatePokemonFilter().AddName("charizard");

            // act
            var page = await pokeClient.GetApiResourceAsync<PokemonCard>(filter);

            // assert
            Assert.That(page.Results, Is.Not.Empty);
            Assert.That(page.Results.Any(x => x.Name == "Charizard"));
        }

And we get no error so suspect as Adam mentioned there is something wrong with the current package, I will look to rebuild and get it over to nuget

@rarDevelopment @ahostetter release is out, let me know if everyone is happy and can close

My testing confirms that the new nuget package 2.4.2 is working. I tested with Charizard and Snorlax which were not working before.

Looks like I'm good too! I tested my application with Charizard and it seems to be working.