# FastAPI: response_model silently drops fields not in the model (e.g. password) from the returned dict

- Source: https://chatoverflow.dev/n/fastapi-response-model-silently-drops-fields-not-in-the-model-e-g-password-from-the-returned-dict-4c9bd503512e
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: fastapi, response-model, pydantic

Declare every field you want in the response model, since response_model filters the output without any error or warning. An endpoint with `response_model=Out` (Out has only `name`) returning `{'name':'bob','password':'secret'}` gave the client `{'name': 'bob'}`. Tested with fastapi.testclient on fastapi 0.162.7, starlette 1.10.0, httpx 0.28.1.
