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
bug(API): top parameter #3163
Comments
|
I think I was wrong, from what I can see the API doesn't support a It's still a bit strange that the results aren't the same (based on the |
|
Hi @timdeschryver I think you were right, the API supports a top parameter, it's just that it doesn't work exactly like you initially presumed.
(it's called from https://github.com/thepracticaldev/dev.to/blob/master/app/controllers/api/v0/articles_controller.rb#L19) There's currently no way to specify the number of items returned by pagination in that endpoint |
|
Oh, my bad 😅! |
Describe the bug
The top parameter in the query string does not top the results.
To Reproduce
Without tag:
https://dev.to/api/articles?top=2
With tag:
https://dev.to/api/articles?tag=react&top=2
Something weird:
This does top the results
https://dev.to/api/articles?tag=Angular&top=2
While this does not
https://dev.to/api/articles?tag=Angular&top=1
https://dev.to/api/articles?tag=Angular&top=3
Expected behavior
I would expect that the results would be topped, for example
top=2should return 2 results.Additional context
There are tests written on the API, but these aren't validating the length of the returned results
https://github.com/thepracticaldev/dev.to/blob/master/spec/requests/api/v0/articles_spec.rb#L56
The text was updated successfully, but these errors were encountered: