Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled invalid api responses #14

Open
ZakkProjects opened this issue Nov 4, 2024 · 1 comment
Open

Unhandled invalid api responses #14

ZakkProjects opened this issue Nov 4, 2024 · 1 comment

Comments

@ZakkProjects
Copy link

Ive stumbled upon few non-desealizable responses from spotify api and created a merge request. For them.
BUT
There seems to be bigger issue on spotify side of the API.

Even when looking at official api docs spotify generates invalid responses. For example this long piece of "episode".

In reality it is object that should never exist. Episode with artist object is not specified. It also misses some parameters that should not be missing. In this case i dont have quick solution for fixing theese issues.

{
  "added_at": "2023-06-06T14:56:14Z",
  "added_by": {
    "external_urls": {
      "spotify": "https://open.spotify.com/user/k79f8pfzzsj35ytb8kf0tuzs9"
    },
    "href": "https://api.spotify.com/v1/users/k79f8pfzzsj35ytb8kf0tuzs9",
    "id": "k79f8pfzzsj35ytb8kf0tuzs9",
    "type": "user",
    "uri": "spotify:user:k79f8pfzzsj35ytb8kf0tuzs9"
  },
  "is_local": false,
  "primary_color": null,
  "track": {
    "preview_url": "https://podz-content.spotifycdn.com/audio/clips/7zurkbkL4BDwntCKay2Qvk/clip_192_60192.mp3",
    "available_markets": ["AR", "AU"],
    "explicit": false,
    "type": "episode",
    "episode": false,
    "track": true,
    "album": {
      "available_markets": ["AR"],
      "type": "show",
      "album_type": "compilation",
      "href": "https://api.spotify.com/v1/shows/35doHI9SUSj3uEVDE1U15Z",
      "id": "35doHI9SUSj3uEVDE1U15Z",
      "images": [
        {
          "height": 640,
          "url": "https://i.scdn.co/image/ab6765630000ba8acbcadfa63cc2d0b1fe9b5934",
          "width": 640
        },
        {
          "height": 300,
          "url": "https://i.scdn.co/image/ab67656300005f1fcbcadfa63cc2d0b1fe9b5934",
          "width": 300
        },
        {
          "height": 64,
          "url": "https://i.scdn.co/image/ab6765630000f68dcbcadfa63cc2d0b1fe9b5934",
          "width": 64
        }
      ],
      "name": "amigos em disparada ",
      "release_date": null,
      "release_date_precision": null,
      "uri": "spotify:show:35doHI9SUSj3uEVDE1U15Z",
      "artists": [
        {
          "external_urls": {
            "spotify": "https://open.spotify.com/show/35doHI9SUSj3uEVDE1U15Z"
          },
          "href": "https://api.spotify.com/v1/shows/35doHI9SUSj3uEVDE1U15Z",
          "id": "35doHI9SUSj3uEVDE1U15Z",
          "name": null,
          "type": "amigos em disparada ",
          "uri": "spotify:show:35doHI9SUSj3uEVDE1U15Z"
        }
      ],
      "external_urls": {
        "spotify": "https://open.spotify.com/album/35doHI9SUSj3uEVDE1U15Z"
      },
      "total_tracks": 1
    },
    "artists": [
      {
        "external_urls": {
          "spotify": "https://open.spotify.com/show/35doHI9SUSj3uEVDE1U15Z"
        },
        "href": "https://api.spotify.com/v1/shows/35doHI9SUSj3uEVDE1U15Z",
        "id": "35doHI9SUSj3uEVDE1U15Z",
        "name": null,
        "type": "amigos em disparada ",
        "uri": "spotify:show:35doHI9SUSj3uEVDE1U15Z"
      }
    ],
    "disc_number": 0,
    "track_number": 0,
    "duration_ms": 238027,
    "external_ids": {
      "spotify": "https://open.spotify.com/episode/5WyVIGqaGeSX5IjGpeGouZ"
    },
    "external_urls": {
      "spotify": "https://open.spotify.com/episode/5WyVIGqaGeSX5IjGpeGouZ"
    },
    "href": "https://api.spotify.com/v1/episodes/5WyVIGqaGeSX5IjGpeGouZ",
    "id": "5WyVIGqaGeSX5IjGpeGouZ",
    "name": "Teenage Dirtbag - One Direction ",
    "popularity": 0,
    "uri": "spotify:episode:5WyVIGqaGeSX5IjGpeGouZ",
    "is_local": false
  },
  "video_thumbnail": { "url": null }
}
@Bogpan
Copy link
Owner

Bogpan commented Dec 28, 2024

Could you please provide actual requests (the specific requests, not just the endpoints) and the issues you've found? What you've provided here isn't an issue, it deserializes fine for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants