You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ArtistsApi.GetRelatedArtists<Artist[]> method throws an exception when deserializing the API response, because it is not accessing the 'artists' property to pull out the data.
SpotifyApi.NetCore.Tests.ArtistsApiTests.GetRelatedArtists_When_Given_Valid_ArtistId_Returns_Artists:
Outcome: Failed
Error Message:
Test method SpotifyApi.NetCore.Tests.ArtistsApiTests.GetRelatedArtists_When_Given_Valid_ArtistId_Returns_Artists threw exception:
Newtonsoft.Json.JsonSerializationException: Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'SpotifyApi.NetCore.Artist[]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly.
To fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List<T>) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object.
Path 'artists', line 2, position 13.
Solution:
Call SpotifyWebApi.GetModelFromProperty() and pass in "artists" for the rootPropertyName
The text was updated successfully, but these errors were encountered:
Issue:
ArtistsApi.GetRelatedArtists<Artist[]>
method throws an exception when deserializing the API response, because it is not accessing the 'artists' property to pull out the data.Solution:
Call
SpotifyWebApi.GetModelFromProperty()
and pass in "artists" for therootPropertyName
The text was updated successfully, but these errors were encountered: