Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add: support for nested pagination meta data #117

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DavidPhilip
Copy link

As the name states I needed to support this for a project I'm working on as the meta data for pagination doesn't necessarily have to lie in the root of the meta object.

Example:

{
  "authors": [
    {
      "id": "1",
      ...
    }
  ],
  "meta": {
    "pagination": {
      "total": 120,
      "count": 25,
      "per_page": 25,
      "current_page": 1,
      "total_pages": 5,
      "links": {
        "next": "http://..."
      }
    }
  }
}

The mapping would then be added to paramMapping for this example like this:

params.paramMapping = { meta: "pagination" };

I suppose I could write tests for this too if I have more time. Take your time, review the code and let me know how you want to continue.

Regards,
David

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant