API Design Pro
Intent
Ensure the backend API is robust, scalable, and well-documented. Applies FastAPI-specific patterns (Dependency Injection, Background Tasks, Pydantic Schemas).
Checklist
- •Pydantic Validation: Are all request/response models strictly typed?
- •Error Handling: Are meaningful HTTP exceptions (400, 404, 500) used correctly?
- •Dependency Injection: Use
Depends()for database sessions, authentication, and service instances. - •Performance: Check for N+1 query problems in SQLAlchemy/Tortoise and ensure async/await is used properly.
- •Security: Ensure OAuth2/JWT tokens are verified where necessary.
Output Format
API Specification Review
- •Endpoint:
[METHOD] /path - •Schema Validation: [Comments on Pydantic models]
- •Security Check: [Pass/Fail]
- •FastAPI Pro-Tip: [A specific FastAPI feature that could improve the code]