Skip to content

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