Check if `value` is valid this property in the entity `obj`. Append
        validation results to `errors` (list).
3002
def check(self, obj, value, errors):
        
        fieldname = "%s.%s" % (type(obj).__name__, self._name)

        if value is None:
            if not self._null:
                errors.append("%s may not be 'null'" % fieldname)

            # If None, just leave. The rest of checks don't make any sense.
            return

        for has_error in [self._has_wrong_type, self._has_wrong_length,
                          self._is_not_one_of, self._has_subproblems]:
            if has_error(fieldname, value, errors):
                break
1071167
def _validate_data(self, path, obj, _):
        
        errs = []

        if obj.type == None and getattr(obj, '$ref') == None:
            errs.append('type or $ref should be existed.')

        # make sure there is 'item' along with 'array'
        if not (obj.type == 'array') == (obj.items != None):
            errs.append('array should be existed along with items')
        if obj.uniqueItems != None and obj.type != 'array':
            errs.append('uniqueItems is only used for array type.')

        return path, obj.__class__.__name__, errs
1142854
def validate(self, value, messages=None):
        
        valid     = True
        primitive = value

        def log(msg):
            if messages is not None:
                messages.append(msg)

        if self.enum:
            if value not in self.enum.values():
                valid = False
                flds = (self.name, str(value))
                log("%s value '%s' not in allowed enumerated values." % flds)
            else:
                primitive = int(self.enum.keys()[self.enum.values().index(value)])

        if self.type:
            if self.type.validate(primitive, messages, self.name) is False:
                valid = False

        return valid
34753
def assert_valid_value(value)
      unless valid?(value)
        raise Property::InvalidValueError.new(self,value)
      end
      true
    end
1331891
def Validate(self, value):
    """"""
    if isinstance(value, string_types):
      raise TypeValueError("Value must be an iterable not a string.")

    elif not isinstance(value, (list, tuple)):
      raise TypeValueError("%r not a valid List" % value)

    # Validate each value in the list validates against our type.
    return [self.validator.Validate(val) for val in value]
124231
def _validate(self, value):
        """"""
        if self.values and value not in self.values:
            raise ValueError(
                '{} is not a valid value for {}'.format(value, self.name))
1146514
def validate_entities(self, model, context=None):
        
        result = Result()
        for property_name in self.entities:
            prop = self.entities[property_name]
            value = self.get(model, property_name)

            errors = prop.validate(
                value=value,
                model=model,
                context=context
            )
            if len(errors):
                result.add_entity_errors(
                    property_name=property_name,
                    direct_errors=errors
                )

            if value is None:
                continue

            schema_valid = prop.validate_with_schema(
                model=value,
                context=context
            )
            if schema_valid == False:
                result.add_entity_errors(
                    property_name,
                    schema_errors=schema_valid.errors
                )

        return result
837395
def validate(self, value):
        
        errors = []
        value = self._validate_type(value, errors)
        self._validate_value(value, errors)

        if errors:
            raise ValidationErrors(errors)

        return value
418537
def validate(self, value, model_instance):
        
        return super(self.__class__, self).validate(value.value, model_instance)
1057456
def validate(self, value):
        
        super(ChoicesField, self).validate(value)
        if value and not self.valid_value(value):
            self._on_invalid_value(value)
113645
def _ensure_value_is_valid(self, value):
        """"""
        if not isinstance(value, self.__class__.value_type):
            raise TypeError('{0} is not valid collection value, instance '
                            'of {1} required'.format(
                                value, self.__class__.value_type))
        return value
826615
def validate(self, value, model_instance):
        """"""
        if isinstance(value, six.string_types):
            super(JSONField, self).validate(value, model_instance)
            try:
                json.loads(value)
            except Exception as err:
                raise ValidationError(str(err))
117483
function validator(value, next) {
    validationErrors = [];
    var isValid = true;

    validatorsArray.forEach(function(validator) {
      validator.validator.call(this, value, function(valid) {
        if (!valid) {
          // Append message
          validationErrors.push(validator.message);

          isValid = false;
        }
      });
    }.bind(this));
    return next(isValid);
  }
604707
def _validate(self, value):
        
        errors = []
        kwargs = {}
        for validator in self.validators:
            try:
                r = validator(value)
                if not isinstance(validator, Validator) and r is False:
                    self.fail('validator_failed')
            except ValidationError as err:
                kwargs.update(err.kwargs)
                if isinstance(err.messages, dict):
                    errors.append(err.messages)
                else:
                    errors.extend(err.messages)
        if errors:
            raise ValidationError(errors, **kwargs)
587367
def validate (properties):
    
    if isinstance(properties, Property):
        properties = [properties]
    assert is_iterable_typed(properties, Property)
    for p in properties:
        __validate1(p)
884964
def validate(self, obj):
        """"""
        if 'tags' in obj and not isinstance(obj['tags'], list):
            raise aomi_excep.Validation('tags must be a list')

        if self.present:
            check_obj(self.required_fields, self.name(), obj)
177584
def validate(self, value):
        
        if value in self.empty_values and self.required:
            raise ValidationError(self.error_messages['required'])