I have a model which takes a few inputs including a sourceSiteId. This is an integer but also has many values as None. I have tried a few things with the model but still receive an error of value is not a valid integer (type=type_error.integer) when the value is None. Below is my model.
class LatLongModel(BaseModel):
# id: str
object_id: Optional[int] = None
primo_id: Optional[int] = None
name: Optional[str] = None
entity_type: Optional[str] = None
division_id: Optional[int] = None
division: Optional[str] = None
status: Optional[str] = None
longitude: Optional[float] = None
latitude: Optional[float] = None
site_id: Optional[int] = None
source_site_id: Optional[int] = None
site_type: Optional[str] = None
I have also tried to do source_site_id: int = None and source_site_id: Optional[int] but no luck. What can I try to get this model to accept integers as well as None type for source_site_id?