Clone wiki

rest-api-blueprint / FetchedResults

Partial Responses

When GETting an item or items, support partial response using an optional ?fields=a,b,c parameter. E.g.

  • /people/tim?fields=name,address

The default is to include all fields.

Potentially this could be extended to navigate an underlying relational model, e.g. if people had pets:

  • /people/tim?fields=name,pet.age

Paginated Results

Always support pagination of results. The most common way to do this is with limit and offset, e.g.:

  • /people?limit=20&offset=10

Use a sensible default such as limit=50 and offset=0.