I have a FastApi application that has the following base model:
class Mint(BaseModel):
investigation: Union[Investigation, None] = None
dataset: Union[List[Dataset], None] = None
datafile: Union[List[Datafile], None] = None
So the Request takes one investigation or one or more datasets or datafiles. How can I change it so one of these HAS to be included in the request body but none of them are madatory?
For example, the body can contain:
- 1 Investigation and 2 datasets
- 1 Investigation
- 2 datasets
- 4 datafiles
thanks