babelshift/SteamWebAPI2

Failing to deserialize into MacRequirements/LinuxRequirements?

ImPhantom opened this issue · 1 comments

I am having an issue that only seems to apply to apps with a colon in their title, all other games I can fetch details from. They seem to fail whilst deserializing into MacRequirements/LinuxRequirements.

Here are a few problematic appids: 380, 10090, 33930, 80

Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'SteamWebAPI2.Models.SteamStore.MacRequirements' because the type requires a JSON object (e.g. {"name":"value"}) to deserialize correctly. To fix this error either change the JSON to a JSON object (e.g. {"name":"value"}) or change the deserialized type to an array or a type that implements a collection interface (e.g. ICollection, IList) like List<T> that can be deserialized from a JSON array. JsonArrayAttribute can also be added to the type to force it to deserialize from a JSON array. Path '80.data.mac_requirements', line 1, position 1389.

Heres the code I was using to test:

        var _store = new SteamStore();
        var details = await _store.GetStoreAppDetailsAsync(appid);
        Console.WriteLine(details.Name);

I'm not exactly proficient in C#, so I'm not to useful when trying to figure these things out.

The problem here is that some games treat Linux Requirements as a single object and others treat it as an array of objects. I don't know how to implement quantum deserialization in which we simultaneously deserialize the same property to different types.

For now, I am going to ignore the property if it's an array.