JsonApiClient / json_api_client

Build client libraries compliant with specification defined by jsonapi.org
MIT License
362 stars 186 forks source link

NestedParamPaginator for endpoint that uses page[offset] & page[limit] #401

Open dshorthouse opened 2 years ago

dshorthouse commented 2 years ago

Help request here.

I am using an endpoint that uses page[offset] and page[limit] & so have made use of:

JsonApiClient::Paginating::NestedParamPaginator.page_param = "offset"
JsonApiClient::Paginating::NestedParamPaginator.per_page_param = "limit"

But, this isn't correct because the endpoint expects an offset and not a page. How do I go about configuring this such that:

Model.page(X).per_page(Y)

...constructs the appropriate parameters when I send the model a page method?