code: def validate(self, val):
          
          if self.validation:
              self.type.validate(val)
  
              if self.custom_validator is not None:
                  self.custom_validator(val)
  
          return True
docs: Validate values according to the requirement