Skip to content

Trying to override pagination... #102

@adambedford

Description

@adambedford

I'm overriding the index action on one of my API endpoints to support searching with Elasticsearch and I need to also paginate with ES but I'm running into an issue. On page 2 (and likely 3,4, etc), jsonapi_render returns an empty dataset even though the collection passed to it contains records. I have a suspicion this is related to pagination - perhaps JR or JU is expecting the collection passed to jsonapi_render to be the full recordset, and then it applies pagination, whereas in my case the collection passed is already paginated because it came from ES.

Is there a way to turn off pagination inside a controller action? I can't go so far as to disable pagination on the resource because the index action needs to behave as normal as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions