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

Recommendations endpoint: unknown variant ARTIST, expected one of artist, track, genre #225

Closed
marioortizmanero opened this issue Jul 14, 2021 · 1 comment · Fixed by #226
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@marioortizmanero
Copy link
Collaborator

Describe the bug
RecommendationsSeedType fails to parse from JSON because its value is upper cased for some queries

To Reproduce
Steps to reproduce the behavior:

  1. cargo test --features=env-file,cli -- --ignored test_recommendations --nocapture

Expected behavior
It should serialize the field properly

Log/Output data

Full log
❯ cargo test --features=env-file,cli -- --ignored test_recommendations --nocapture
 Compiling rspotify-model v0.10.0 (/home/mario/Programming/rspotify/rspotify-model)
 Compiling rspotify-http v0.10.0 (/home/mario/Programming/rspotify/rspotify-http)
 Compiling rspotify v0.10.0 (/home/mario/Programming/rspotify)
  Finished test [unoptimized + debuginfo] target(s) in 14.07s
   Running unittests (/home/mario/.cache/cargo/debug/deps/rspotify-f662cac47348a9d0)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 7 filtered out; finished in 0.00s

   Running tests/test_enums.rs (/home/mario/.cache/cargo/debug/deps/test_enums-c6098ad37f7e5309)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 12 filtered out; finished in 0.00s

   Running tests/test_models.rs (/home/mario/.cache/cargo/debug/deps/test_models-8f63e2ac83d73782)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 19 filtered out; finished in 0.00s

   Running tests/test_oauth2.rs (/home/mario/.cache/cargo/debug/deps/test_oauth2-5e4c1307fcebff39)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 5 filtered out; finished in 0.00s

   Running tests/test_with_credential.rs (/home/mario/.cache/cargo/debug/deps/test_with_credential-905b24653cdf7c6d)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 17 filtered out; finished in 0.00s

   Running tests/test_with_oauth.rs (/home/mario/.cache/cargo/debug/deps/test_with_oauth-cdc82f29404319bb)

running 1 test
result: {
"tracks" : [ {
  "album" : {
    "album_type" : "SINGLE",
    "artists" : [ {
      "external_urls" : {
        "spotify" : "https://open.spotify.com/artist/5vBSrE1xujD2FXYRarbAXc"
      },
      "href" : "https://api.spotify.com/v1/artists/5vBSrE1xujD2FXYRarbAXc",
      "id" : "5vBSrE1xujD2FXYRarbAXc",
      "name" : "Years & Years",
      "type" : "artist",
      "uri" : "spotify:artist:5vBSrE1xujD2FXYRarbAXc"
    } ],
    "external_urls" : {
      "spotify" : "https://open.spotify.com/album/2dzxJbiJKhQo2aqUrtjZP0"
    },
    "href" : "https://api.spotify.com/v1/albums/2dzxJbiJKhQo2aqUrtjZP0",
    "id" : "2dzxJbiJKhQo2aqUrtjZP0",
    "images" : [ {
      "height" : 640,
      "url" : "https://i.scdn.co/image/ab67616d0000b2737e98a30f3a9af0fb35771ae1",
      "width" : 640
    }, {
      "height" : 300,
      "url" : "https://i.scdn.co/image/ab67616d00001e027e98a30f3a9af0fb35771ae1",
      "width" : 300
    }, {
      "height" : 64,
      "url" : "https://i.scdn.co/image/ab67616d000048517e98a30f3a9af0fb35771ae1",
      "width" : 64
    } ],
    "name" : "Take Shelter",
    "release_date" : "2014-01-01",
    "release_date_precision" : "day",
    "total_tracks" : 4,
    "type" : "album",
    "uri" : "spotify:album:2dzxJbiJKhQo2aqUrtjZP0"
  },
  "artists" : [ {
    "external_urls" : {
      "spotify" : "https://open.spotify.com/artist/5vBSrE1xujD2FXYRarbAXc"
    },
    "href" : "https://api.spotify.com/v1/artists/5vBSrE1xujD2FXYRarbAXc",
    "id" : "5vBSrE1xujD2FXYRarbAXc",
    "name" : "Years & Years",
    "type" : "artist",
    "uri" : "spotify:artist:5vBSrE1xujD2FXYRarbAXc"
  } ],
  "disc_number" : 1,
  "duration_ms" : 233228,
  "explicit" : false,
  "external_ids" : {
    "isrc" : "GBUM71403184"
  },
  "external_urls" : {
    "spotify" : "https://open.spotify.com/track/267nfLfaSSDa9ivHncHynh"
  },
  "href" : "https://api.spotify.com/v1/tracks/267nfLfaSSDa9ivHncHynh",
  "id" : "267nfLfaSSDa9ivHncHynh",
  "is_local" : false,
  "is_playable" : true,
  "name" : "Breathe",
  "popularity" : 66,
  "preview_url" : null,
  "track_number" : 3,
  "type" : "track",
  "uri" : "spotify:track:267nfLfaSSDa9ivHncHynh"
}, {
  "album" : {
    "album_type" : "SINGLE",
    "artists" : [ {
      "external_urls" : {
        "spotify" : "https://open.spotify.com/artist/2KEqzdPS7M5YwGmiuPTdr5"
      },
      "href" : "https://api.spotify.com/v1/artists/2KEqzdPS7M5YwGmiuPTdr5",
      "id" : "2KEqzdPS7M5YwGmiuPTdr5",
      "name" : "Rina Sawayama",
      "type" : "artist",
      "uri" : "spotify:artist:2KEqzdPS7M5YwGmiuPTdr5"
    } ],
    "external_urls" : {
      "spotify" : "https://open.spotify.com/album/07wf8AuTUtfUR9MlopkRBM"
    },
    "href" : "https://api.spotify.com/v1/albums/07wf8AuTUtfUR9MlopkRBM",
    "id" : "07wf8AuTUtfUR9MlopkRBM",
    "images" : [ {
      "height" : 640,
      "url" : "https://i.scdn.co/image/ab67616d0000b273c1ac5374769f060b8a96c3c8",
      "width" : 640
    }, {
      "height" : 300,
      "url" : "https://i.scdn.co/image/ab67616d00001e02c1ac5374769f060b8a96c3c8",
      "width" : 300
    }, {
      "height" : 64,
      "url" : "https://i.scdn.co/image/ab67616d00004851c1ac5374769f060b8a96c3c8",
      "width" : 64
    } ],
    "name" : "Cherry",
    "release_date" : "2018-08-14",
    "release_date_precision" : "day",
    "total_tracks" : 1,
    "type" : "album",
    "uri" : "spotify:album:07wf8AuTUtfUR9MlopkRBM"
  },
  "artists" : [ {
    "external_urls" : {
      "spotify" : "https://open.spotify.com/artist/2KEqzdPS7M5YwGmiuPTdr5"
    },
    "href" : "https://api.spotify.com/v1/artists/2KEqzdPS7M5YwGmiuPTdr5",
    "id" : "2KEqzdPS7M5YwGmiuPTdr5",
    "name" : "Rina Sawayama",
    "type" : "artist",
    "uri" : "spotify:artist:2KEqzdPS7M5YwGmiuPTdr5"
  } ],
  "disc_number" : 1,
  "duration_ms" : 205224,
  "explicit" : false,
  "external_ids" : {
    "isrc" : "GBENL1802242"
  },
  "external_urls" : {
    "spotify" : "https://open.spotify.com/track/36RGU7buus2UUtrPZ78hkR"
  },
  "href" : "https://api.spotify.com/v1/tracks/36RGU7buus2UUtrPZ78hkR",
  "id" : "36RGU7buus2UUtrPZ78hkR",
  "is_local" : false,
  "is_playable" : true,
  "name" : "Cherry",
  "popularity" : 62,
  "preview_url" : "https://p.scdn.co/mp3-preview/fe0c2343fb0578844728892f98228fd3861ebd69?cid=e1dce60f1e274e20861ce5d96142a4d3",
  "track_number" : 1,
  "type" : "track",
  "uri" : "spotify:track:36RGU7buus2UUtrPZ78hkR"
}, {
  "album" : {
    "album_type" : "ALBUM",
    "artists" : [ {
      "external_urls" : {
        "spotify" : "https://open.spotify.com/artist/3hv9jJF3adDNsBSIQDqcjp"
      },
      "href" : "https://api.spotify.com/v1/artists/3hv9jJF3adDNsBSIQDqcjp",
      "id" : "3hv9jJF3adDNsBSIQDqcjp",
      "name" : "Mark Ronson",
      "type" : "artist",
      "uri" : "spotify:artist:3hv9jJF3adDNsBSIQDqcjp"
    }, {
      "external_urls" : {
        "spotify" : "https://open.spotify.com/artist/5D19FUPuoRUpCBtWoY14C4"
      },
      "href" : "https://api.spotify.com/v1/artists/5D19FUPuoRUpCBtWoY14C4",
      "id" : "5D19FUPuoRUpCBtWoY14C4",
      "name" : "The Business Intl",
      "type" : "artist",
      "uri" : "spotify:artist:5D19FUPuoRUpCBtWoY14C4"
    } ],
    "external_urls" : {
      "spotify" : "https://open.spotify.com/album/0m8wvW3WNm9D7J0KUlbf3h"
    },
    "href" : "https://api.spotify.com/v1/albums/0m8wvW3WNm9D7J0KUlbf3h",
    "id" : "0m8wvW3WNm9D7J0KUlbf3h",
    "images" : [ {
      "height" : 640,
      "url" : "https://i.scdn.co/image/ab67616d0000b2734e1ce5c19325a80d8300cb64",
      "width" : 640
    }, {
      "height" : 300,
      "url" : "https://i.scdn.co/image/ab67616d00001e024e1ce5c19325a80d8300cb64",
      "width" : 300
    }, {
      "height" : 64,
      "url" : "https://i.scdn.co/image/ab67616d000048514e1ce5c19325a80d8300cb64",
      "width" : 64
    } ],
    "name" : "Record Collection",
    "release_date" : "2010-09-21",
    "release_date_precision" : "day",
    "total_tracks" : 14,
    "type" : "album",
    "uri" : "spotify:album:0m8wvW3WNm9D7J0KUlbf3h"
  },
  "artists" : [ {
    "external_urls" : {
      "spotify" : "https://open.spotify.com/artist/3hv9jJF3adDNsBSIQDqcjp"
    },
    "href" : "https://api.spotify.com/v1/artists/3hv9jJF3adDNsBSIQDqcjp",
    "id" : "3hv9jJF3adDNsBSIQDqcjp",
    "name" : "Mark Ronson",
    "type" : "artist",
    "uri" : "spotify:artist:3hv9jJF3adDNsBSIQDqcjp"
  }, {
    "external_urls" : {
      "spotify" : "https://open.spotify.com/artist/5D19FUPuoRUpCBtWoY14C4"
    },
    "href" : "https://api.spotify.com/v1/artists/5D19FUPuoRUpCBtWoY14C4",
    "id" : "5D19FUPuoRUpCBtWoY14C4",
    "name" : "The Business Intl",
    "type" : "artist",
    "uri" : "spotify:artist:5D19FUPuoRUpCBtWoY14C4"
  }, {
    "external_urls" : {
      "spotify" : "https://open.spotify.com/artist/7gQNLR8mykA1KjGClbPYHe"
    },
    "href" : "https://api.spotify.com/v1/artists/7gQNLR8mykA1KjGClbPYHe",
    "id" : "7gQNLR8mykA1KjGClbPYHe",
    "name" : "MNDR",
    "type" : "artist",
    "uri" : "spotify:artist:7gQNLR8mykA1KjGClbPYHe"
  } ],
  "disc_number" : 1,
  "duration_ms" : 233626,
  "explicit" : true,
  "external_ids" : {
    "isrc" : "GBARL1001209"
  },
  "external_urls" : {
    "spotify" : "https://open.spotify.com/track/44AL9Xok81qGEOZdPQpUnM"
  },
  "href" : "https://api.spotify.com/v1/tracks/44AL9Xok81qGEOZdPQpUnM",
  "id" : "44AL9Xok81qGEOZdPQpUnM",
  "is_local" : false,
  "is_playable" : true,
  "name" : "Bang Bang Bang (feat. MNDR)",
  "popularity" : 51,
  "preview_url" : "https://p.scdn.co/mp3-preview/eb21aeb40d9dfdfa4917d718636e8bbb51640ff0?cid=e1dce60f1e274e20861ce5d96142a4d3",
  "track_number" : 1,
  "type" : "track",
  "uri" : "spotify:track:44AL9Xok81qGEOZdPQpUnM"
}, {
  "album" : {
    "album_type" : "SINGLE",
    "artists" : [ {
      "external_urls" : {
        "spotify" : "https://open.spotify.com/artist/4WUGQykLBGFfsl0Qjl6TDM"
      },
      "href" : "https://api.spotify.com/v1/artists/4WUGQykLBGFfsl0Qjl6TDM",
      "id" : "4WUGQykLBGFfsl0Qjl6TDM",
      "name" : "The Magician",
      "type" : "artist",
      "uri" : "spotify:artist:4WUGQykLBGFfsl0Qjl6TDM"
    } ],
    "external_urls" : {
      "spotify" : "https://open.spotify.com/album/7yDiBp7t2j6OT7KopH2ulG"
    },
    "href" : "https://api.spotify.com/v1/albums/7yDiBp7t2j6OT7KopH2ulG",
    "id" : "7yDiBp7t2j6OT7KopH2ulG",
    "images" : [ {
      "height" : 640,
      "url" : "https://i.scdn.co/image/ab67616d0000b273419b0aec29b934f46ab318f6",
      "width" : 640
    }, {
      "height" : 300,
      "url" : "https://i.scdn.co/image/ab67616d00001e02419b0aec29b934f46ab318f6",
      "width" : 300
    }, {
      "height" : 64,
      "url" : "https://i.scdn.co/image/ab67616d00004851419b0aec29b934f46ab318f6",
      "width" : 64
    } ],
    "name" : "Sunlight (feat. Years & Years) [Radio Edit]",
    "release_date" : "2014-08-15",
    "release_date_precision" : "day",
    "total_tracks" : 1,
    "type" : "album",
    "uri" : "spotify:album:7yDiBp7t2j6OT7KopH2ulG"
  },
  "artists" : [ {
    "external_urls" : {
      "spotify" : "https://open.spotify.com/artist/4WUGQykLBGFfsl0Qjl6TDM"
    },
    "href" : "https://api.spotify.com/v1/artists/4WUGQykLBGFfsl0Qjl6TDM",
    "id" : "4WUGQykLBGFfsl0Qjl6TDM",
    "name" : "The Magician",
    "type" : "artist",
    "uri" : "spotify:artist:4WUGQykLBGFfsl0Qjl6TDM"
  }, {
    "external_urls" : {
      "spotify" : "https://open.spotify.com/artist/5vBSrE1xujD2FXYRarbAXc"
    },
    "href" : "https://api.spotify.com/v1/artists/5vBSrE1xujD2FXYRarbAXc",
    "id" : "5vBSrE1xujD2FXYRarbAXc",
    "name" : "Years & Years",
    "type" : "artist",
    "uri" : "spotify:artist:5vBSrE1xujD2FXYRarbAXc"
  } ],
  "disc_number" : 1,
  "duration_ms" : 193481,
  "explicit" : false,
  "external_ids" : {
    "isrc" : "GB01A1400003"
  },
  "external_urls" : {
    "spotify" : "https://open.spotify.com/track/5r3aYGutXgsxSqB6W3RrzJ"
  },
  "href" : "https://api.spotify.com/v1/tracks/5r3aYGutXgsxSqB6W3RrzJ",
  "id" : "5r3aYGutXgsxSqB6W3RrzJ",
  "is_local" : false,
  "is_playable" : true,
  "name" : "Sunlight (feat. Years and Years) - Radio Edit",
  "popularity" : 61,
  "preview_url" : "https://p.scdn.co/mp3-preview/5113979adaae94d922a1104c0c8ec2bbeda95430?cid=e1dce60f1e274e20861ce5d96142a4d3",
  "track_number" : 1,
  "type" : "track",
  "uri" : "spotify:track:5r3aYGutXgsxSqB6W3RrzJ"
}, {
  "album" : {
    "album_type" : "ALBUM",
    "artists" : [ {
      "external_urls" : {
        "spotify" : "https://open.spotify.com/artist/0wnYgCeP013HkKoOyC5V32"
      },
      "href" : "https://api.spotify.com/v1/artists/0wnYgCeP013HkKoOyC5V32",
      "id" : "0wnYgCeP013HkKoOyC5V32",
      "name" : "Allie X",
      "type" : "artist",
      "uri" : "spotify:artist:0wnYgCeP013HkKoOyC5V32"
    } ],
    "external_urls" : {
      "spotify" : "https://open.spotify.com/album/4J8jmljF3FvpyhPjyB1fae"
    },
    "href" : "https://api.spotify.com/v1/albums/4J8jmljF3FvpyhPjyB1fae",
    "id" : "4J8jmljF3FvpyhPjyB1fae",
    "images" : [ {
      "height" : 640,
      "url" : "https://i.scdn.co/image/ab67616d0000b27332ef63bcb552e1e9c1ecf475",
      "width" : 640
    }, {
      "height" : 300,
      "url" : "https://i.scdn.co/image/ab67616d00001e0232ef63bcb552e1e9c1ecf475",
      "width" : 300
    }, {
      "height" : 64,
      "url" : "https://i.scdn.co/image/ab67616d0000485132ef63bcb552e1e9c1ecf475",
      "width" : 64
    } ],
    "name" : "Cape God",
    "release_date" : "2020-02-21",
    "release_date_precision" : "day",
    "total_tracks" : 12,
    "type" : "album",
    "uri" : "spotify:album:4J8jmljF3FvpyhPjyB1fae"
  },
  "artists" : [ {
    "external_urls" : {
      "spotify" : "https://open.spotify.com/artist/0wnYgCeP013HkKoOyC5V32"
    },
    "href" : "https://api.spotify.com/v1/artists/0wnYgCeP013HkKoOyC5V32",
    "id" : "0wnYgCeP013HkKoOyC5V32",
    "name" : "Allie X",
    "type" : "artist",
    "uri" : "spotify:artist:0wnYgCeP013HkKoOyC5V32"
  }, {
    "external_urls" : {
      "spotify" : "https://open.spotify.com/artist/2uYWxilOVlUdk4oV9DvwqK"
    },
    "href" : "https://api.spotify.com/v1/artists/2uYWxilOVlUdk4oV9DvwqK",
    "id" : "2uYWxilOVlUdk4oV9DvwqK",
    "name" : "Mitski",
    "type" : "artist",
    "uri" : "spotify:artist:2uYWxilOVlUdk4oV9DvwqK"
  } ],
  "disc_number" : 1,
  "duration_ms" : 238880,
  "explicit" : false,
  "external_ids" : {
    "isrc" : "GBKPL1975990"
  },
  "external_urls" : {
    "spotify" : "https://open.spotify.com/track/32tUYhAygMdx9XxFxxj3It"
  },
  "href" : "https://api.spotify.com/v1/tracks/32tUYhAygMdx9XxFxxj3It",
  "id" : "32tUYhAygMdx9XxFxxj3It",
  "is_local" : false,
  "is_playable" : true,
  "name" : "Susie Save Your Love",
  "popularity" : 60,
  "preview_url" : "https://p.scdn.co/mp3-preview/2f8a8b0aeca47333d1919d9ffc886514670db895?cid=e1dce60f1e274e20861ce5d96142a4d3",
  "track_number" : 9,
  "type" : "track",
  "uri" : "spotify:track:32tUYhAygMdx9XxFxxj3It"
}, {
  "album" : {
    "album_type" : "ALBUM",
    "artists" : [ {
      "external_urls" : {
        "spotify" : "https://open.spotify.com/artist/1IueXOQyABrMOprrzwQJWN"
      },
      "href" : "https://api.spotify.com/v1/artists/1IueXOQyABrMOprrzwQJWN",
      "id" : "1IueXOQyABrMOprrzwQJWN",
      "name" : "Sigala",
      "type" : "artist",
      "uri" : "spotify:artist:1IueXOQyABrMOprrzwQJWN"
    } ],
    "external_urls" : {
      "spotify" : "https://open.spotify.com/album/5rr0xAQfk01cPi1N37jX11"
    },
    "href" : "https://api.spotify.com/v1/albums/5rr0xAQfk01cPi1N37jX11",
    "id" : "5rr0xAQfk01cPi1N37jX11",
    "images" : [ {
      "height" : 640,
      "url" : "https://i.scdn.co/image/ab67616d0000b273681d6da9a0ab5ff23fadf0f9",
      "width" : 640
    }, {
      "height" : 300,
      "url" : "https://i.scdn.co/image/ab67616d00001e02681d6da9a0ab5ff23fadf0f9",
      "width" : 300
    }, {
      "height" : 64,
      "url" : "https://i.scdn.co/image/ab67616d00004851681d6da9a0ab5ff23fadf0f9",
      "width" : 64
    } ],
    "name" : "Brighter Days",
    "release_date" : "2018-09-28",
    "release_date_precision" : "day",
    "total_tracks" : 16,
    "type" : "album",
    "uri" : "spotify:album:5rr0xAQfk01cPi1N37jX11"
  },
  "artists" : [ {
    "external_urls" : {
      "spotify" : "https://open.spotify.com/artist/1IueXOQyABrMOprrzwQJWN"
    },
    "href" : "https://api.spotify.com/v1/artists/1IueXOQyABrMOprrzwQJWN",
    "id" : "1IueXOQyABrMOprrzwQJWN",
    "name" : "Sigala",
    "type" : "artist",
    "uri" : "spotify:artist:1IueXOQyABrMOprrzwQJWN"
  }, {
    "external_urls" : {
      "spotify" : "https://open.spotify.com/artist/7mWMzxN6IAIQ1tfFFtAiQv"
    },
    "href" : "https://api.spotify.com/v1/artists/7mWMzxN6IAIQ1tfFFtAiQv",
    "id" : "7mWMzxN6IAIQ1tfFFtAiQv",
    "name" : "Bryn Christopher",
    "type" : "artist",
    "uri" : "spotify:artist:7mWMzxN6IAIQ1tfFFtAiQv"
  } ],
  "disc_number" : 1,
  "duration_ms" : 202213,
  "explicit" : false,
  "external_ids" : {
    "isrc" : "GBCEN1501213"
  },
  "external_urls" : {
    "spotify" : "https://open.spotify.com/track/1qp0ptMXNg9hqLH8sk7cc2"
  },
  "href" : "https://api.spotify.com/v1/tracks/1qp0ptMXNg9hqLH8sk7cc2",
  "id" : "1qp0ptMXNg9hqLH8sk7cc2",
  "is_local" : false,
  "is_playable" : true,
  "name" : "Sweet Lovin' - Radio Edit",
  "popularity" : 66,
  "preview_url" : "https://p.scdn.co/mp3-preview/afd0c02d7e875035485ca3e148f62634e7ea0c40?cid=e1dce60f1e274e20861ce5d96142a4d3",
  "track_number" : 11,
  "type" : "track",
  "uri" : "spotify:track:1qp0ptMXNg9hqLH8sk7cc2"
}, {
  "album" : {
    "album_type" : "SINGLE",
    "artists" : [ {
      "external_urls" : {
        "spotify" : "https://open.spotify.com/artist/6oBm8HB0yfrIc9IHbxs6in"
      },
      "href" : "https://api.spotify.com/v1/artists/6oBm8HB0yfrIc9IHbxs6in",
      "id" : "6oBm8HB0yfrIc9IHbxs6in",
      "name" : "Lykke Li",
      "type" : "artist",
      "uri" : "spotify:artist:6oBm8HB0yfrIc9IHbxs6in"
    } ],
    "external_urls" : {
      "spotify" : "https://open.spotify.com/album/7bL1fTsGeOyxv29BNVtMb1"
    },
    "href" : "https://api.spotify.com/v1/albums/7bL1fTsGeOyxv29BNVtMb1",
    "id" : "7bL1fTsGeOyxv29BNVtMb1",
    "images" : [ {
      "height" : 640,
      "url" : "https://i.scdn.co/image/ab67616d0000b2734e520169fed8748fcb8317ad",
      "width" : 640
    }, {
      "height" : 300,
      "url" : "https://i.scdn.co/image/ab67616d00001e024e520169fed8748fcb8317ad",
      "width" : 300
    }, {
      "height" : 64,
      "url" : "https://i.scdn.co/image/ab67616d000048514e520169fed8748fcb8317ad",
      "width" : 64
    } ],
    "name" : "sex money feelings die (slowed version)",
    "release_date" : "2019-10-18",
    "release_date_precision" : "day",
    "total_tracks" : 1,
    "type" : "album",
    "uri" : "spotify:album:7bL1fTsGeOyxv29BNVtMb1"
  },
  "artists" : [ {
    "external_urls" : {
      "spotify" : "https://open.spotify.com/artist/6oBm8HB0yfrIc9IHbxs6in"
    },
    "href" : "https://api.spotify.com/v1/artists/6oBm8HB0yfrIc9IHbxs6in",
    "id" : "6oBm8HB0yfrIc9IHbxs6in",
    "name" : "Lykke Li",
    "type" : "artist",
    "uri" : "spotify:artist:6oBm8HB0yfrIc9IHbxs6in"
  } ],
  "disc_number" : 1,
  "duration_ms" : 168810,
  "explicit" : true,
  "external_ids" : {
    "isrc" : "USRC11902770"
  },
  "external_urls" : {
    "spotify" : "https://open.spotify.com/track/0dkvbYmXYEPK7gGMdytmfI"
  },
  "href" : "https://api.spotify.com/v1/tracks/0dkvbYmXYEPK7gGMdytmfI",
  "id" : "0dkvbYmXYEPK7gGMdytmfI",
  "is_local" : false,
  "is_playable" : true,
  "name" : "sex money feelings die - slowed version",
  "popularity" : 75,
  "preview_url" : "https://p.scdn.co/mp3-preview/99eec4c526fea8f2e857e8038bad215c2a4d33d4?cid=e1dce60f1e274e20861ce5d96142a4d3",
  "track_number" : 1,
  "type" : "track",
  "uri" : "spotify:track:0dkvbYmXYEPK7gGMdytmfI"
}, {
  "album" : {
    "album_type" : "SINGLE",
    "artists" : [ {
      "external_urls" : {
        "spotify" : "https://open.spotify.com/artist/4QM5QCHicznALtX885CnZC"
      },
      "href" : "https://api.spotify.com/v1/artists/4QM5QCHicznALtX885CnZC",
      "id" : "4QM5QCHicznALtX885CnZC",
      "name" : "Slayyyter",
      "type" : "artist",
      "uri" : "spotify:artist:4QM5QCHicznALtX885CnZC"
    } ],
    "external_urls" : {
      "spotify" : "https://open.spotify.com/album/3SQr5VHmYRkAGGMTCBbbnP"
    },
    "href" : "https://api.spotify.com/v1/albums/3SQr5VHmYRkAGGMTCBbbnP",
    "id" : "3SQr5VHmYRkAGGMTCBbbnP",
    "images" : [ {
      "height" : 640,
      "url" : "https://i.scdn.co/image/ab67616d0000b2739390a9abd94385f7ef1b7d66",
      "width" : 640
    }, {
      "height" : 300,
      "url" : "https://i.scdn.co/image/ab67616d00001e029390a9abd94385f7ef1b7d66",
      "width" : 300
    }, {
      "height" : 64,
      "url" : "https://i.scdn.co/image/ab67616d000048519390a9abd94385f7ef1b7d66",
      "width" : 64
    } ],
    "name" : "Mine",
    "release_date" : "2019-05-03",
    "release_date_precision" : "day",
    "total_tracks" : 1,
    "type" : "album",
    "uri" : "spotify:album:3SQr5VHmYRkAGGMTCBbbnP"
  },
  "artists" : [ {
    "external_urls" : {
      "spotify" : "https://open.spotify.com/artist/4QM5QCHicznALtX885CnZC"
    },
    "href" : "https://api.spotify.com/v1/artists/4QM5QCHicznALtX885CnZC",
    "id" : "4QM5QCHicznALtX885CnZC",
    "name" : "Slayyyter",
    "type" : "artist",
    "uri" : "spotify:artist:4QM5QCHicznALtX885CnZC"
  } ],
  "disc_number" : 1,
  "duration_ms" : 159013,
  "explicit" : false,
  "external_ids" : {
    "isrc" : "QM24S1905471"
  },
  "external_urls" : {
    "spotify" : "https://open.spotify.com/track/18uOcUO5mNEYHHigeXPgQM"
  },
  "href" : "https://api.spotify.com/v1/tracks/18uOcUO5mNEYHHigeXPgQM",
  "id" : "18uOcUO5mNEYHHigeXPgQM",
  "is_local" : false,
  "is_playable" : true,
  "name" : "Mine",
  "popularity" : 61,
  "preview_url" : "https://p.scdn.co/mp3-preview/2b2fb4affb138ce8effcfc76eceb58020b9f2a7a?cid=e1dce60f1e274e20861ce5d96142a4d3",
  "track_number" : 1,
  "type" : "track",
  "uri" : "spotify:track:18uOcUO5mNEYHHigeXPgQM"
}, {
  "album" : {
    "album_type" : "SINGLE",
    "artists" : [ {
      "external_urls" : {
        "spotify" : "https://open.spotify.com/artist/3Xt3RrJMFv5SZkCfUE8C1J"
      },
      "href" : "https://api.spotify.com/v1/artists/3Xt3RrJMFv5SZkCfUE8C1J",
      "id" : "3Xt3RrJMFv5SZkCfUE8C1J",
      "name" : "Kim Petras",
      "type" : "artist",
      "uri" : "spotify:artist:3Xt3RrJMFv5SZkCfUE8C1J"
    } ],
    "external_urls" : {
      "spotify" : "https://open.spotify.com/album/7AiqBnEFt4gCA9XpKUoZRl"
    },
    "href" : "https://api.spotify.com/v1/albums/7AiqBnEFt4gCA9XpKUoZRl",
    "id" : "7AiqBnEFt4gCA9XpKUoZRl",
    "images" : [ {
      "height" : 640,
      "url" : "https://i.scdn.co/image/ab67616d0000b2734fb33fc345ca2252f4bf18ab",
      "width" : 640
    }, {
      "height" : 300,
      "url" : "https://i.scdn.co/image/ab67616d00001e024fb33fc345ca2252f4bf18ab",
      "width" : 300
    }, {
      "height" : 64,
      "url" : "https://i.scdn.co/image/ab67616d000048514fb33fc345ca2252f4bf18ab",
      "width" : 64
    } ],
    "name" : "Malibu",
    "release_date" : "2020-05-07",
    "release_date_precision" : "day",
    "total_tracks" : 1,
    "type" : "album",
    "uri" : "spotify:album:7AiqBnEFt4gCA9XpKUoZRl"
  },
  "artists" : [ {
    "external_urls" : {
      "spotify" : "https://open.spotify.com/artist/3Xt3RrJMFv5SZkCfUE8C1J"
    },
    "href" : "https://api.spotify.com/v1/artists/3Xt3RrJMFv5SZkCfUE8C1J",
    "id" : "3Xt3RrJMFv5SZkCfUE8C1J",
    "name" : "Kim Petras",
    "type" : "artist",
    "uri" : "spotify:artist:3Xt3RrJMFv5SZkCfUE8C1J"
  } ],
  "disc_number" : 1,
  "duration_ms" : 191808,
  "explicit" : false,
  "external_ids" : {
    "isrc" : "GBKPL2098226"
  },
  "external_urls" : {
    "spotify" : "https://open.spotify.com/track/31k41EAntOsjbRBcAASfiL"
  },
  "href" : "https://api.spotify.com/v1/tracks/31k41EAntOsjbRBcAASfiL",
  "id" : "31k41EAntOsjbRBcAASfiL",
  "is_local" : false,
  "is_playable" : true,
  "name" : "Malibu",
  "popularity" : 62,
  "preview_url" : "https://p.scdn.co/mp3-preview/edfafbc22738959191493c23ae69843a25acf65b?cid=e1dce60f1e274e20861ce5d96142a4d3",
  "track_number" : 1,
  "type" : "track",
  "uri" : "spotify:track:31k41EAntOsjbRBcAASfiL"
}, {
  "album" : {
    "album_type" : "ALBUM",
    "artists" : [ {
      "external_urls" : {
        "spotify" : "https://open.spotify.com/artist/3WGpXCj9YhhfX11TToZcXP"
      },
      "href" : "https://api.spotify.com/v1/artists/3WGpXCj9YhhfX11TToZcXP",
      "id" : "3WGpXCj9YhhfX11TToZcXP",
      "name" : "Troye Sivan",
      "type" : "artist",
      "uri" : "spotify:artist:3WGpXCj9YhhfX11TToZcXP"
    } ],
    "external_urls" : {
      "spotify" : "https://open.spotify.com/album/3MYJYd73u0SatCnRVvRJ3M"
    },
    "href" : "https://api.spotify.com/v1/albums/3MYJYd73u0SatCnRVvRJ3M",
    "id" : "3MYJYd73u0SatCnRVvRJ3M",
    "images" : [ {
      "height" : 640,
      "url" : "https://i.scdn.co/image/ab67616d0000b273aae542061ac42ee04779fb2f",
      "width" : 640
    }, {
      "height" : 300,
      "url" : "https://i.scdn.co/image/ab67616d00001e02aae542061ac42ee04779fb2f",
      "width" : 300
    }, {
      "height" : 64,
      "url" : "https://i.scdn.co/image/ab67616d00004851aae542061ac42ee04779fb2f",
      "width" : 64
    } ],
    "name" : "Bloom",
    "release_date" : "2018-08-31",
    "release_date_precision" : "day",
    "total_tracks" : 10,
    "type" : "album",
    "uri" : "spotify:album:3MYJYd73u0SatCnRVvRJ3M"
  },
  "artists" : [ {
    "external_urls" : {
      "spotify" : "https://open.spotify.com/artist/3WGpXCj9YhhfX11TToZcXP"
    },
    "href" : "https://api.spotify.com/v1/artists/3WGpXCj9YhhfX11TToZcXP",
    "id" : "3WGpXCj9YhhfX11TToZcXP",
    "name" : "Troye Sivan",
    "type" : "artist",
    "uri" : "spotify:artist:3WGpXCj9YhhfX11TToZcXP"
  }, {
    "external_urls" : {
      "spotify" : "https://open.spotify.com/artist/66CXWjxzNUsdJxJ2JdwvnR"
    },
    "href" : "https://api.spotify.com/v1/artists/66CXWjxzNUsdJxJ2JdwvnR",
    "id" : "66CXWjxzNUsdJxJ2JdwvnR",
    "name" : "Ariana Grande",
    "type" : "artist",
    "uri" : "spotify:artist:66CXWjxzNUsdJxJ2JdwvnR"
  } ],
  "disc_number" : 1,
  "duration_ms" : 231846,
  "explicit" : false,
  "external_ids" : {
    "isrc" : "AUUM71800523"
  },
  "external_urls" : {
    "spotify" : "https://open.spotify.com/track/2NjO87HyT80fsgejd3PLYW"
  },
  "href" : "https://api.spotify.com/v1/tracks/2NjO87HyT80fsgejd3PLYW",
  "id" : "2NjO87HyT80fsgejd3PLYW",
  "is_local" : false,
  "is_playable" : true,
  "name" : "Dance To This (feat. Ariana Grande)",
  "popularity" : 69,
  "preview_url" : null,
  "track_number" : 6,
  "type" : "track",
  "uri" : "spotify:track:2NjO87HyT80fsgejd3PLYW"
} ],
"seeds" : [ {
  "initialPoolSize" : 279,
  "afterFilteringSize" : 175,
  "afterRelinkingSize" : 175,
  "id" : "4NHQUGzhtTLFvgF5SZesLK",
  "type" : "ARTIST",
  "href" : "https://api.spotify.com/v1/artists/4NHQUGzhtTLFvgF5SZesLK"
}, {
  "initialPoolSize" : 345,
  "afterFilteringSize" : 50,
  "afterRelinkingSize" : 50,
  "id" : "0c6xIDDpzE81m2q797ordA",
  "type" : "TRACK",
  "href" : "https://api.spotify.com/v1/tracks/0c6xIDDpzE81m2q797ordA"
} ]
}
thread 'test_recommendations' panicked at 'called `Result::unwrap()` on an `Err` value: ParseJson(Error("unknown variant `ARTIST`, expected one of `artist`, `trac
k`, `genre`", line: 741, column: 21))', tests/test_with_oauth.rs:413:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
test test_recommendations ... FAILED

failures:

failures:
  test_recommendations

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 46 filtered out; finished in 0.31s

error: test failed, to rerun pass '--test test_with_oauth'
@marioortizmanero marioortizmanero added bug Something isn't working help wanted Extra attention is needed labels Jul 14, 2021
@marioortizmanero marioortizmanero changed the title recommendations endpoint: unknown variant ARTIST, expected one of artist, trac k, genre Recommendations endpoint: unknown variant ARTIST, expected one of artist, track, genre Jul 14, 2021
@marioortizmanero
Copy link
Collaborator Author

This is fixed by just using #[serde(rename_all = "UPPERCASE")] AFAIK, but it still weirds me out that it's in upper case. Not sure if it should just be case insensitive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant