Closed EAZYLINK closed 2 weeks ago
@EAZYLINK update the Expected Outcome object to follow the accepted conventions
@nedssoft Updated
@EAZYLINK I didn't say you should remove the technical specs, take it back to what it was and read the slack message about conventions to understand what I meant
@nedssoft I have made the changes
Make this codeblock instead of code lines
You also need something like this
version your api also
@EAZYLINK prepend v1
to your API endpoint e.g v1/api/products
@markessien @nedssoft I have limited access to this ticket
What access do you want?
What access do you want?
assign
Description
Develop an API endpoint to list products with pagination support. The endpoint should return basic information about each product, including the product name, price, and category.
Acceptance Criteria
Product name
Product price
Product category
page: Current page number (default is 1)
limit: Number of products per page (default is 10)
Purpose
To provide a means for clients to retrieve a paginated list of products with essential details, enhancing the user experience by allowing them to browse products efficiently.
Requirements
Request example
GET /api/products?page=1&limit=10
Expected Outcome
Response(bad request):
Response(Error):
Additional Notes:
The endpoint should be secured and require appropriate authentication/authorization.
Ensure the API follows RESTful conventions.
Use appropriate HTTP status codes for success and error scenarios.
Testing
Test that the endpoint returns a 200 on successful product retrieval.
Test that invalid data triggers a 400 Bad Request response with an appropriate error message.
Test that the returned product lists are within specified page and limits.
Test that the endpoint triggers a 500 Internal server error on failed attempt to access the database