[GH-ISSUE #1152] Bug: Error parsing API response when performing a search #557

Open
opened 2026-02-28 14:49:50 +03:00 by kerem · 1 comment
Owner

Originally created by @Harthuz on GitHub (Apr 21, 2025).
Original GitHub issue: https://github.com/Rigellute/spotify-tui/issues/1152

Description:

When performing a search in the application, an error occurs while parsing the response from the Spotify API.

The error message is:

Api response: convert result failed, reason: Error("invalid type: null, expected struct SimplifiedPlaylist", line: 1, column: 273)

This suggests that the application attempted to parse a null value into a SimplifiedPlaylist structure, which is not allowed.

Steps to Reproduce:

  1. Open the application.
  2. Go to the search field.
  3. Type any search term and submit.
  4. The above error is triggered.

Screenshot of the error:

Image

Possible Cause:

The Spotify API may return null for certain fields when there are no results or missing data. The app currently expects every item to conform to the SimplifiedPlaylist structure, so it's crashing instead of handling null values gracefully.

Suggestion:

Add a check before parsing the API response to ensure that null values are handled appropriately or filtered out before deserialization.

Originally created by @Harthuz on GitHub (Apr 21, 2025). Original GitHub issue: https://github.com/Rigellute/spotify-tui/issues/1152 **Description:** When performing a search in the application, an error occurs while parsing the response from the Spotify API. The error message is: ``` Api response: convert result failed, reason: Error("invalid type: null, expected struct SimplifiedPlaylist", line: 1, column: 273) ``` This suggests that the application attempted to parse a `null` value into a `SimplifiedPlaylist` structure, which is not allowed. **Steps to Reproduce:** 1. Open the application. 2. Go to the search field. 3. Type any search term and submit. 4. The above error is triggered. **Screenshot of the error:** ![Image](https://github.com/user-attachments/assets/30f7a1fd-4271-4689-96ff-aebcb3d0b406) **Possible Cause:** The Spotify API may return `null` for certain fields when there are no results or missing data. The app currently expects every item to conform to the `SimplifiedPlaylist` structure, so it's crashing instead of handling `null` values gracefully. **Suggestion:** Add a check before parsing the API response to ensure that `null` values are handled appropriately or filtered out before deserialization.
Author
Owner

@sewnie commented on GitHub (Apr 21, 2025):

Spotify-tui has unfortunately been abandoned by the author, and since then, the Spotify API changed signficantly, breaking this project. You may also notice breaking Rust and library changes.

Please use spotify_player: https://github.com/aome510/spotify-player, which is more feature-packed and more convenient.

<!-- gh-comment-id:2818881168 --> @sewnie commented on GitHub (Apr 21, 2025): Spotify-tui has unfortunately been abandoned by the author, and since then, the Spotify API changed signficantly, breaking this project. You may also notice breaking Rust and library changes. Please use spotify_player: https://github.com/aome510/spotify-player, which is more feature-packed and more convenient.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotify-tui#557
No description provided.