Skip to content

GetNextPage on Playlists from search results deserializes incorrectly #85

@ellkay-joshe

Description

@ellkay-joshe

Calling GetNextPage on the Playlists from a SearchItemsAsync call doesn't seem to deserialize correctly.

Really simple code sample to reproduce issue:

        var firstPage = await _spotify.SearchItemsAsync("punk", SearchType.Playlist, 50);

        var secondPage = await _spotify.GetNextPageAsync(firstPage.Playlists);

        if (secondPage.Items == null)
        {
            throw new NullReferenceException("Items null");
        }

image

secondPage.Items ends up being null. Looking at the json it's trying to deserialize, it's because the SimplePlaylist model doesn't match what spotify is returning.

{ "playlists" : { "href" : "https://api.spotify.com/v1/search?query=punk&offset=50&limit=50&type=playlist", "items" : [ { "collaborative" : false, "external_urls" : { "spotify" : "http://open.spotify.com/user/billludwig/playlist/0uxgkOIkRVXe2Y8SRto7YM" ...

Am I doing something wrong? Or does the method need to be updated to handle this? I'd be happy to take a crack at fixing it as long as I'm understanding this correctly. Am I just calling the wrong method?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions