def __validate_attributes__(self):
        if self.required not in (True, False):
            raise RuntimeError(
                '\'required\' can only be True/False'
            )
Run any validation check you need the instance attributes.
dataset/ETHPy150Open saltstack/salt/salt/utils/schema.py/SchemaItem.__validate_attributes__