I need to parse a list of strings where strings are heterogeneous type. Ex: {data : ["+91-8827222222", "int_val", "str_val", "+91-8827222223", "+91-8827222224"]}
i want to verify above list, but not able to get exact answer of my question anywhere, I followed few references but it didn't helped. Parse list of Pydantic classes from list of strings https://fastapi.tiangolo.com/fr/tutorial/body-nested-models/
I Need something like this,
class mobile_no(data):
# validation code
class UserData(BaseModel):
data: List[mobile_no, str, int]
Will appreciate your help :)