API documentation with OpenAPI/Swagger — endpoint descriptions, request/response
66
57%
Does it follow best practices?
Impact
100%
1.06xAverage score across 3 eval scenarios
Passed
No known issues
A mid-size retailer is building an inventory management platform and needs a Python backend to track products and stock levels. The backend team has decided to use FastAPI. You have been asked to implement a small but realistic slice of the API that the frontend and mobile teams will consume.
The service needs to support the following operations:
The API will be consumed by both internal frontend developers and external partners, so it is important that the documentation is thorough and accessible directly from the running service.
Implement the FastAPI application in a file called main.py. The application should be runnable with uvicorn main:app.
Also produce a requirements.txt listing all dependencies needed to install and run the service.
Write a short README.md explaining how to install dependencies and start the server, including where to find the API documentation once it is running.
Do not start or run the server as part of this task — just produce the source files.