Problem statement
The /users/me page broke the day someone added /users/{user_id}: now me is read as a user id. Declare the routes so the fixed path and the parameterized path both work, and add a file route that keeps nested slashes.
Requirements
The app, the GET / home route and the three handlers, read_user, read_current_user and read_file_path, are already provided, together with what they return. Your task has one part, in app/main.py: make each of the three handlers a path operation.
FastAPI checks routes in the order they appear in the file and uses the first one that matches, so a parameterized path that comes first also catches a fixed path like /users/me. The path converter lets one path parameter take a value that contains slashes.
- read_current_user handles GET /users/me and returns {"username": "current_user", "is_current": true}. It comes before /users/{user_id} in the file, so me is never read as a user id
- read_user handles GET /users/{user_id}. /users/42 returns {"user_id": 42, "username": "user_42", "is_current": false}
- read_file_path handles GET /files/{file_path} with the path converter, so it captures a nested path with all its slashes: /files/a/b/c/d.txt returns {"file_path": "a/b/c/d.txt"}
Sample Requests & Responses
GET /users/me
Response (200 OK):
{"username": "current_user", "is_current": true}
GET /users/42
Response (200 OK):
{"user_id": 42, "username": "user_42", "is_current": false}
GET /files/a/b/c/d.txt
Response (200 OK):
{"file_path": "a/b/c/d.txt"}
