23 / 65 · 14 API Testing Fundamentals · Response Validation← prev⊞ allnext →☰ Read as one page
3.7Practical Exercise
Write response validation tests for an API with the following endpoints:
GET /products— returns paginated list with items, total, page, per_pageGET /products/:id— returns single product with id, name, price, categoryPOST /products— creates a product, returns 201 with the new product- Test pagination: no overlap, correct totals, boundary pages
- Test response structure: required fields, correct types, no sensitive data
- Test sorting: verify
sort=pricereturns items in ascending price order