We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement an API endpoint to update a product by its ID.
The purpose of this endpoint is to allow users to update the details of a specific product by its ID.
/api/v1/products/{product_id}
name
description
price
category
quantity
404 Not Found
200 OK
500 Internal Server Error
PUT /api/v1/products/123
{ "name": "Updated Product Name", "description": "Updated description of the product", "price": 20, "category": "Electronics", "quantity": 100 }
{ "status": "Success", "message": "Product updated successfully", "status_code": 200, "data": { "id": 123, "name": "Updated Product Name", "description": "Updated description of the product", "price": 20, "quantity": 100, "category": "Electronics" } }
{ "status": "Not Found", "message": "Product not found", "status_code": 404 }
{ "status": "An unexpected error occurred", "message": "Internal server error", "status_code": 500 }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
Implement an API endpoint to update a product by its ID.
Acceptance Criteria
Purpose
The purpose of this endpoint is to allow users to update the details of a specific product by its ID.
Requirement
/api/v1/products/{product_id}
.name
(string)description
(string)price
(number)category
(string)quantity
(number)404 Not Found
status.200 OK
status with the updated product information.200 OK
) and unsuccessful requests404 Not Found
,500 Internal Server Error
).Request Example
PUT /api/v1/products/123
Successful Response
Unsuccessful Response
Unit Tests
Expected Outcome
The text was updated successfully, but these errors were encountered: