CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/fastapi-error-handling

Production error handling for FastAPI — exception handlers, structured error

96

6.12x
Quality

96%

Does it follow best practices?

Impact

98%

6.12x

Average score across 5 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

task.mdevals/scenario-5/

User Registration and Profile API

Build a user registration and profile management API with FastAPI and Python.

Endpoints

  • POST /api/users -- register a new user with username: str (3-20 chars, alphanumeric), email: str, password: str (min 8 chars), full_name: str
  • GET /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: str

Business rules:

  • Username and email must be unique
  • Cannot update or delete an already-deactivated user
  • Old password must match when changing password

Output

Produce Python files:

  • app/main.py -- FastAPI app with routes
  • app/schemas.py -- Pydantic models for request/response bodies
  • app/store.py -- in-memory user store (dict-based, no real database)

Do not include test files, authentication middleware, or deployment configuration.

evals

tile.json