SpotifyAPI icon indicating copy to clipboard operation
SpotifyAPI copied to clipboard

Update playlist images to be optional.

Open jlopez opened this issue 1 year ago • 2 comments

The Playlist API just started returning a null image array (instead of an empty array as the documentation suggests and the code assumes). This change prevents the JSONDecoder from crashing when decoding such playlists.

jlopez avatar Mar 22 '24 17:03 jlopez

Change the code to decode a value of null into an empty array. This will avoid breaking API compatibility. In order to accomplish this, you must add a public init(from decoder: Decoder) throws method to Playlist, similar to the method in Album: https://github.com/Peter-Schorn/SpotifyAPI/blob/52a0e30f9f36221ee73da30004e4e6e5a389ab2f/Sources/SpotifyWebAPI/Object%20Model/Music%20Objects/Album.swift#L276-L349

Peter-Schorn avatar Mar 22 '24 20:03 Peter-Schorn

Please try 03799102987847ab6674f275b729dd5bdd9fe5f0 (or the latest commit on master).

Peter-Schorn avatar Apr 14 '24 08:04 Peter-Schorn

Implemented in version 3.0.1.

Peter-Schorn avatar May 26 '24 02:05 Peter-Schorn