Optional params on API endpoint produce invalid pagination header links
Zendesk: https://gitlab.zendesk.com/agent/tickets/93688
In https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/15469, optional parameters were added to the repository contributors endpoint (ex. api/v4/projects/2091/repository/contributors
) allowing users to specify an order by or sort value. This works fine.
However, it seems that either the header pagination link that is generated is invalid when the optional attributes are not specified, or the way the option params are used in the endpoint cause this problem.
The header pagination link that is generated is something like /api/v4/projects/2091/repository/contributors?id=2091&order_by=&page=3&per_page=20&sort=
which then produces an error:
order_by does not have a valid value, sort does not have a valid value
@rymai Do you have any ideas here? You reviewed the mentioned merge request. I'm not sure if this is something the endpoint itself needs to account for or if the generation of the link headers is not correct.
@nick.thomas IIRC you had something to do with the pagination header links in the past so maybe you have some thoughts, too?