Input models (UserCreate) accept only what clients may send, output models (UserPublic) expose only safe fields, and database models carry internal fields such as hashed passwords and IDs.
Separating them prevents leaking data, avoids letting clients set fields such as is_admin (mass assignment), and keeps the API contract stable when the database changes.
Loading…