Current Working
The Services view (and Service Types view) currently loads all results in a single request. As registries grow, this will become a performance and UX problem. Pagination needs to be added.
Both GET /services and GET /services/types return bare JSON arrays with no query parameters for pagination and no pagination metadata in the response.
TASC pagination guide: Recommends either page-based (page + page_size) or token-based (token + page_size) pagination, with a response envelope of the form { results: [...], pagination: { page, page_size, total, ... } }. We will be using the page + page_size approach.
Backwards-compatible approach
- Accept two optional query parameters on GET
/servicesand GET /services/types - page and page_size
- When neither parameter is provided, return all results or the full json(as the current response).
- When pagination parameters are present, return the response as the pagination guide suggests (
{ results: [...], pagination: { page, page_size, total, ... } }).
- Return 400 Bad Request if page exceeds available pages.
This is backwards-compatible approach to add pagination without breaking the existing clients.
Current Working
The Services view (and Service Types view) currently loads all results in a single request. As registries grow, this will become a performance and UX problem. Pagination needs to be added.
Both GET
/servicesand GET/services/typesreturn bare JSON arrays with no query parameters for pagination and no pagination metadata in the response.TASC pagination guide: Recommends either page-based (page + page_size) or token-based (token + page_size) pagination, with a response envelope of the form
{ results: [...], pagination: { page, page_size, total, ... } }. We will be using the page + page_size approach.Backwards-compatible approach
/servicesand GET/services/types-pageandpage_size{ results: [...], pagination: { page, page_size, total, ... } }).This is backwards-compatible approach to add pagination without breaking the existing clients.