This issue tracker is no longer used. Join us in the Spotify for Developers forum for support with the Spotify Web API ➡️ https://community.spotify.com/t5/Spotify-for-Developers/bd-p/Spotify_Developer
983
stars
79
forks
source link
Inconsistent handling of trailing commas in the ids param for /v1/tracks & /v1/audio-features #1572
Context: Both these calls have a query parameter called "ids". "ids" accepts a comma delimited string of Spotify IDs for tracks. However, "/v1/audio-features" will handle a trailing comma, while "/v1/tracks" does not. This can be most easily reproduced via the examples in their respective references -
It would be ideal if behaviour was consistent across both calls, as the parameter has the same name & both calls are sorted under the same "Tracks" section in the reference document. A user is likely to assume they share the same/similar logic.
I suspect that the intended behaviour is that "/v1/audio-features" shouldn't accept a trailing comma, particularly because JSON objects aren't supposed to accept them.
Actual behaviour:
The following is recieved, in the case of "/v1/tracks":
Issue found on 5th May 2020
Endpoint(s):
Scope(s):
Steps to reproduce:
Context: Both these calls have a query parameter called "ids". "ids" accepts a comma delimited string of Spotify IDs for tracks. However, "/v1/audio-features" will handle a trailing comma, while "/v1/tracks" does not. This can be most easily reproduced via the examples in their respective references -
Expected behaviour:
It would be ideal if behaviour was consistent across both calls, as the parameter has the same name & both calls are sorted under the same "Tracks" section in the reference document. A user is likely to assume they share the same/similar logic.
I suspect that the intended behaviour is that "/v1/audio-features" shouldn't accept a trailing comma, particularly because JSON objects aren't supposed to accept them.
Actual behaviour:
The following is recieved, in the case of "/v1/tracks":
{ "error": { "status": 400, "message": "invalid id" } }
In the case of "/v1/audio-features":
{ "audio_features": [...] }