Made Playlist Images Optional
Spotify playlists with no tracks will have images as nil. Current Playlist model has images as non-nil & causes decoding error.
- Images are now optional in Playlist model
- Images are also optional in Playlist Initializer
Hi Ashwin.
In order to maintain API stability, please change the decoding logic so that a value of null/ a missing image key in the JSON is decoded into an empty array. Existing clients rely on the images property being non-nil. This also means that changing the Playlist initializer is unecessary.
After testing my code with an empty playlist that contains no images, I found that it already correctly decodes a value of null for the images key in the JSON into an empty array. My code can also handle the case where the images key is missing from the JSON entirely. Thus, I cannot reproduce this error. If you are still experiencing a decoding error, please create an issue.