from pydantic import BaseModel class MyModel(BaseModel): id: int name: str # this should be optional MyModel(id=1) This raises a ValidationError. Setting name: str | None = None is unacceptable because the name cannot be null. It can be a string, or it can be unset, but it can never be null. How do I make this work? Continue reading...