[GH-ISSUE #530] JSON parsing error when getting show #169

Closed
opened 2026-02-27 20:23:32 +03:00 by kerem · 2 comments
Owner

Originally created by @SolidTux on GitHub (Jun 26, 2025).
Original GitHub issue: https://github.com/ramsayleung/rspotify/issues/530

Describe the bug

When attempting to obtain a show, the following error is produced:

Error: json parse error: invalid type: null, expected struct SimplifiedEpisode at line 1 column 2697

Caused by:
    invalid type: null, expected struct SimplifiedEpisode at line 1 column 2697

To Reproduce

The issue can be reproduced with the following code:

use std::{collections::HashMap, fs::File, io::Write};

use rspotify::{ClientCredsSpotify, Credentials, model::ShowId, prelude::BaseClient};

const SHOW_ID: &str = "1TthQOE4Fx6gBPW8l48cfN";

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let spotify = ClientCredsSpotify::new(Credentials::from_env().unwrap());
    spotify.request_token().await?;
    let data = spotify
        .api_get(&format!("shows/{SHOW_ID}"), &HashMap::new())
        .await?;
    write!(File::create("show.json")?, "{data}")?;
    let show = spotify.get_a_show(ShowId::from_id(SHOW_ID)?, None).await?;
    println!("{show:#?}");
    Ok(())
}

I also attached the JSON. The issues seems to be with null items:

Image

Expected behavior

The show data is obtained and properly parsed

Log/Output data

show.json

Additional context

None

Originally created by @SolidTux on GitHub (Jun 26, 2025). Original GitHub issue: https://github.com/ramsayleung/rspotify/issues/530 **Describe the bug** When attempting to obtain a show, the following error is produced: ``` Error: json parse error: invalid type: null, expected struct SimplifiedEpisode at line 1 column 2697 Caused by: invalid type: null, expected struct SimplifiedEpisode at line 1 column 2697 ``` **To Reproduce** The issue can be reproduced with the following code: ```rust use std::{collections::HashMap, fs::File, io::Write}; use rspotify::{ClientCredsSpotify, Credentials, model::ShowId, prelude::BaseClient}; const SHOW_ID: &str = "1TthQOE4Fx6gBPW8l48cfN"; #[tokio::main] async fn main() -> anyhow::Result<()> { let spotify = ClientCredsSpotify::new(Credentials::from_env().unwrap()); spotify.request_token().await?; let data = spotify .api_get(&format!("shows/{SHOW_ID}"), &HashMap::new()) .await?; write!(File::create("show.json")?, "{data}")?; let show = spotify.get_a_show(ShowId::from_id(SHOW_ID)?, None).await?; println!("{show:#?}"); Ok(()) } ``` I also attached the JSON. The issues seems to be with `null` items: ![Image](https://github.com/user-attachments/assets/9982f26f-9f13-4933-88b6-6ee537f3425b) **Expected behavior** The show data is obtained and properly parsed **Log/Output data** [show.json](https://github.com/user-attachments/files/20924978/show.json) **Additional context** _None_
kerem 2026-02-27 20:23:32 +03:00
Author
Owner

@ramsayleung commented on GitHub (Jul 7, 2025):

This problem should be fixed by this PR https://github.com/ramsayleung/rspotify/pull/526/files, I am about to release a new version, you could consume the latest version to solve this problem.

<!-- gh-comment-id:3043322346 --> @ramsayleung commented on GitHub (Jul 7, 2025): This problem should be fixed by this PR https://github.com/ramsayleung/rspotify/pull/526/files, I am about to release a new version, you could consume the latest version to solve this problem.
Author
Owner

@ramsayleung commented on GitHub (Jul 8, 2025):

v0.15.0 is out, which should address this issue.

<!-- gh-comment-id:3049765721 --> @ramsayleung commented on GitHub (Jul 8, 2025): [v0.15.0](https://crates.io/crates/rspotify) is out, which should address this issue.
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/rspotify#169
No description provided.