Unrecognised item type error when using fields on GetPlaylistItems
I'm calling
spotify.Client.GetPlaylistItems(ctx, id, spotify.Fields("items(track(id))"))
and I get the error:
unrecognized item type:
I'm assuming this is because it's expecting to decode the rest of the fields that don't exist.
I'd expect it to just give me back tracks with only the id populated.
I'm confused what spotify.Fields("items(track(id))") is in your case, are you passing a valid spotify playlist ID?
Yeah, the playlistID is valid. The call works fine without the Fields parameter. See the code here.
I'm trying to use this endpoint as follows:
I see, the unmarshaling of the JSON expects the item type, using the filter its missing in func (t *PlaylistItemTrack) UnmarshalJSON.
Also it doesnt work for filters like spotify.Fields("items(track(name))").
I guess when using a Field it can't be expected that the PlaylistItemTrack matches the received JSON.
So is there something we can do about this or is it a lost cause? Do other endpoints play nicely with the fields param?