Closed chuck-stein closed 1 year ago
Yep, this is correct. Enum name shouldn't be used for this special case. I'll fix this and make sure a test references this token value.
Closing with release 4.0.1. Please download and try!
Thanks for looking into this. Unfortunately it looks like the fix only affected certain endpoints. After updating to the latest version, I am still getting 400s for the endpoints I was hitting, namely:
browse.getRecommendations
browse.getCategoryList
albums.getAlbum
artists.getArtistAlbums
I do know that I updated correctly, because if I click into the artists.getArtistTopTracks
endpoint, for example, I do see it using the new market.getSpotifyId()
extension. However, if I click into the endpoints I listed above, I still see them using market?.name
.
I'm also guessing that isn't an exhaustive list, so it's probably worth just searching for and replacing all usages of market.name
. Thanks again for the help!
Describe the bug When making a request with
Market.FROM_TOKEN
, the request will fail withSpotifyException.BadRequestException
due to an HTTP 400 error.To Reproduce Steps to reproduce the behavior:
Market.FROM_TOKEN
. For example:SpotifyException.BadRequestException
is thrown, with error code 400.Expected behavior A successful response from the endpoint, providing content (such as recommended tracks) relevant to the user's current market/country (pulled from their auth token).
Smartphone (please complete the following information):
Additional context The 400 error is happening because the
market
parameter is resolved by getting the enum name, which isFROM_TOKEN
. However, this is not a valid Spotify market -- it should befrom_token
in all lowercase instead.