jellyfin / TMDbLib

C#.Net library for TheMovieDB
MIT License
344 stars 128 forks source link

Deserialization fails for Popular Persons data #432

Open dpjha84 opened 1 year ago

dpjha84 commented 1 year ago

I get JsonSerializationException exception when I try to deserialize the "Popular Persons" data using newtonsoft.json. Following is the error I get-

Newtonsoft.Json.JsonSerializationException: Could not create an instance of type TMDbLib.Objects.Search.KnownForBase. Type is an interface or abstract class and cannot be instantiated. Path 'PopularPersons_1.Data.results[0].known_for[0].first_air_date', line 1, position 143. at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateNewObject(JsonReader reader, JsonObjectContract objectContract, JsonProperty containerMember, JsonProperty containerProperty, String id, Boolean& createdFromNonDefaultCreator) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)

Following is the API I call on TMDBLib-

await tmdbClient.GetPersonPopularListAsync(page: 1);

Any pointer to fix this or work around will be highly appreciated. Thanks in advance.