Production error handling for FastAPI — exception handlers, structured error
96
96%
Does it follow best practices?
Impact
98%
6.12xAverage score across 5 eval scenarios
Passed
No known issues
Build a user registration and profile management API with FastAPI and Python.
POST /api/users -- register a new user with username: str (3-20 chars, alphanumeric), email: str, password: str (min 8 chars), full_name: strGET /api/users/{user_id} -- get user profile (never return password)PATCH /api/users/{user_id} -- update user profile fields (partial update)DELETE /api/users/{user_id} -- soft-delete a user (set is_active = False)POST /api/users/{user_id}/change-password -- change password with old_password: str, new_password: strBusiness rules:
Produce Python files:
app/main.py -- FastAPI app with routesapp/schemas.py -- Pydantic models for request/response bodiesapp/store.py -- in-memory user store (dict-based, no real database)Do not include test files, authentication middleware, or deployment configuration.