Let's say I have a Pydantic model with validation: Name = Annotated[str, AfterValidator(validate_name)] class Foo(BaseModel): id: UUID = Field(default_factory=uuid4) name: Name And a FastAPI endpoint: @app.post('/foos') def create_foo(foo: Foo) -> Foo: save_to_database(foo) return foo I only want the caller to be able to pass a value for name, but not for id. Is there any way to do something like this? def create_foo(foo: Annotated[Foo, Body(include=['id'])]) -> Foo: I know I can do: @app.post('/foos') def create_foo(name: Annotated[str, Body(embed=True)]) -> Foo: foo = Foo(name=name) save_to_database(foo) return foo But then the implicit validation error handling doesn't work anymore, and I need to add more code to do that. Any elegant way of handling that? Continue reading...