Exclude one or more fields in Pydantic model from appearing in FastAPI responses The Problem Some of the Pydantic models in my FastAPI project include secret internal fields that I don’t want to expose in the API response or generated documentation.
Exclude one or more fields in Pydantic model from appearing in FastAPI responses The Problem Some of the Pydantic models in my FastAPI project include secret internal fields that I don’t want to expose in the API response or generated documentation.

TechiSeek helps users find tech companies, products, services, solutions, experts, jobs, events, news, insights and more.
Terms of Service · Privacy Policy
© 2026 TechiSeek. All rights reserved.