twitchdev / issues

Issue tracker for third party developers.
Apache License 2.0
73 stars 6 forks source link

Wrong pagination parameter in documention for /extensions/live endpoint #524

Open beheh opened 2 years ago

beheh commented 2 years ago

Brief description The documentation for https://dev.twitch.tv/docs/api/reference#get-extension-live-channels (/helix/extensions/live) states that the pagination should use the after parameter. This does not work. A little bit of experimentation later, and the parameter is actually named cursor.

You can try this yourself by fetching a popular extension such as https://api.twitch.tv/helix/extensions/live?extension_id=h6dtaffesjnw2704mr5om5dppejukg and trying to call it with an ?after= parameter. You will notice that the server ignores this parameter and returns the same payload with the same cursor again.

Expected documentation

cursor | string | The cursor used to fetch the next page of data.

Screenshots

image

Additional context or questions

I'd like to call out that this endpoint highlights inconsistencies in the new Twitch API:

As a first step obviously the documentation issue above should be corrected. But I would suggest investigating if this endpoint (and apparently the Hypetrain endpoint) can be unified to both cleanly respect the ?after parameter (instead of ?cursor) and for the Extensions endpoint to switch to a wrapped pagination object.

BarryCarlyon commented 2 years ago

Sounds like this should be a API Bug and not a documentation bug.

Since the API should be consistent on how it reports and use pagination. Rather than some endpoints using after and some using cursor

As TwitchCLI reports:

 twitch api get 'extensions/live?extension_id=h6dtaffesjnw2704mr5om5dppejukg'
Error unmarshalling body: json: cannot unmarshal string into Go struct field APIResponse.pagination of type models.APIPagination%  

Which suggests it's actually an API bug as the model the Twitch CLI has is correct.