17 Scaling collection endpoints with filters and pagination
This chapter covers
- Designing filters, pagination, and sorting for APIs
- Enhancing the PetSitter OpenAPI definition with these features
As the PetSitter application grows, a lot of jobs will eventually be posted in the system at the same time. Pet sitters will have a hard time going through all the job postings to find those they are interested in. Also, the API response for listing all jobs may get too large to handle and slow down the app. The PetSitter team realized this during their sprint planning in chapter 16. At that time they decided to implement filters and pagination to solve the issue. While discussing these, we’re also going to look at a third related topic: sorting.
Get Designing APIs with Swagger and OpenAPI now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.