The response_model parameter declares the shape of an endpoint's response. FastAPI uses it to validate, filter, and serialize the returned data — and to document the response in the API docs. Its most important job: ensuring you only expose the intended fields (e.g. never leaking a password).
The problem: leaking sensitive fields
():
name:
email:
password:
() -> User:
db.get_user()
