I am currently working with following nested model (FinalModel):
class Model1(BaseModel):
count: int
class Model2(BaseModel):
method: str
selector: dict
count: int
class FinalModel(BaseModel):
slow: bool
models: Tuple[
Optional[Model1],
Optional[Model2],
]]
I am expecting the Tuple to have a variable length since I'd like to pass in either Model1 or Model2 or both based on the requirements. However, the tuple seems to be expecting a fixed length of 2.
Please note that Union is not an option for me since I expect number of models to increase in future and the possible combinations will increase as well.