0
class User(BaseModel):
     id: int
     name: str
     email: Optinal[str]
     age: int
     place1: str
     place2: str

This is my model class and here place1 and place2 are two fields i need compulsorily one field but either place1 or place2. so if i have get place1 then no need place2 and vice versa how to validate this.

thanks for all inputs.

Chris
  • 18,724
  • 6
  • 46
  • 80
Rohit
  • 23
  • 3

0 Answers0