I have a class
class Animal(BaseModel):
type: str # can be dog, cat or duck
voice: str # can woof, meow, quack
As we can see, there are 2 connected variables, because, for example, a dog cannot quack. How to make this so that I have dependencies on the values in two variables in EXACTLY ONE CLASS?
I need all this in order to have a more understandable scheme of the fastapi input parameters.
The point is that in the scheme it was written that the duck croaks, the dog barks, and the cat meows. I'm not really sure that this is possible, but it sounds like someone has already done it.