rspotify icon indicating copy to clipboard operation
rspotify copied to clipboard

json parse error when getting playlist with no image

Open aome510 opened this issue 6 months ago • 16 comments

Describe the bug Calling get-playlist API with playlist having no image will return a response with images field null. However, according to https://docs.rs/rspotify-model/0.12.0/rspotify_model/playlist/struct.FullPlaylist.html, rspotify specifies the field as Vec<Image>. This leads to the following error when parsing the json response:

json parse error: invalid type: null, expected a sequence at line 1 column 293: invalid type: null, expected a sequence at line 1 column 293

To Reproduce Steps to reproduce the behavior:

  1. Create a new playlist with Spotify, making sure that it has no image
  2. Call get-playlist API using the new playlist's URI
  3. Observe images field has a value of null

aome510 avatar Feb 24 '24 19:02 aome510