Initial paging for topics in category is failing

I think an issue was introduced regarding paging when getting topics for a category.

/c/{id}.json?page=0 doesn’t work anymore. We get a 400 errors with invalid_parameters.
We need to remove the page parameter when value is 0. page=1 is valid (but that is the 2nd page).
page=0 used to be valid.

page=0 is working when getting posts from topics.
I think it should be consistent and have support for page=0 everywhere for all types. It makes the use of your API easier.

This was indeed changed recently. @gerhard should be able to provide some background on the change.
https://github.com/discourse/discourse/commit/f33433bf9e0c1b57c5862d8e5c7ae28579b5bd3b

Right. Looks like I got confused by the fact that we always converted invalid page numbers to 1 and assumed that page numbers start at 1. Sorry about that.

https://github.com/discourse/discourse/commit/26082688d1c01aad8174cccc36cddeda96aa6978

7 Likes