modrinth / labrinth

Our Rust-based backend utilizing the actix-web framework to serve Modrinth's API.

Home Page:https://modrinth.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`GET /v2/search` - If the offset parameter is less than the limit parameter, it is ignored

Zechiax opened this issue · comments

Describe the bug

If the offset is less than the limit parameter, e.g. limit is 10 and offset is 1, the results returned are not offset but remain the same as if the offset were 0, unless the offset is >= than limit.

Steps to reproduce

The results are the same unless offset it >= than the limit

  1. Offset not applied - Search with offset 1, limit 4
  2. Offset not applied - Search with offset 2, limit 4
  3. Offset not applied - Search with offset 3, limit 4
  4. Offset applied - Search with offset 4, limit 4

Expected behavior

The offset should be applied even if it is less than the limit parameter.

Additional context

As it it mostly used for paging, where the offset is usually equal to the limit, it's not much of a problem.