flask-combo-jsonapi

https://secure.travis-ci.org/AdCombo/flask-combo-jsonapi.svg?branch=master

Navigation

  • Installation
  • A minimal API
  • Filtering API example
  • Quickstart
  • Logical data abstraction
  • Resource Manager
  • Data layer
  • Routing
  • Filtering
  • Include related objects
  • Sparse fieldsets
  • Pagination
    • Size
    • Number
    • Size + Number
    • Disable pagination
  • Sorting
  • Errors
  • Api
  • Permission
  • OAuth
  • Configuration

Related Topics

  • Documentation overview
    • Previous: Sparse fieldsets
    • Next: Sorting

Quick search

Pagination¶

When you use the default implementation of the get method on a ResourceList your results will be paginated by default. Default pagination size is 30 but you can manage it from querystring parameter named “page”.

Note

Examples are not URL encoded for a better readability

Size¶

You can control page size like this:

GET /persons?page[size]=10 HTTP/1.1
Accept: application/vnd.api+json

Number¶

You can control page number like this:

GET /persons?page[number]=2 HTTP/1.1
Accept: application/vnd.api+json

Size + Number¶

Of course, you can control both like this:

GET /persons?page[size]=10&page[number]=2 HTTP/1.1
Accept: application/vnd.api+json

Disable pagination¶

You can disable pagination by setting size to 0

GET /persons?page[size]=0 HTTP/1.1
Accept: application/vnd.api+json
©2020, AdCombo. | Powered by Sphinx 4.1.2 & Alabaster 0.7.12 | Page source
Fork me on GitHub