Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
path,
strict)
errors = []
# Optional field with optional value? Who cares.
if (data is None and
validator.is_optional and
validator.can_be_none):
return errors
errors += self._validate_primitive(validator, data, path)
if errors:
return errors
if isinstance(validator, val.Include):
errors += self._validate_include(validator, data, path, strict)
elif isinstance(validator, (val.Map, val.List)):
errors += self._validate_map_list(validator, data, path, strict)
elif isinstance(validator, val.Any):
errors += self._validate_any(validator, data, path, strict)
return errors
errors = []
# Optional field with optional value? Who cares.
if (data is None and
validator.is_optional and
validator.can_be_none):
return errors
errors += self._validate_primitive(validator, data, path)
if errors:
return errors
if isinstance(validator, val.Include):
errors += self._validate_include(validator, data, path, strict)
elif isinstance(validator, (val.Map, val.List)):
errors += self._validate_map_list(validator, data, path, strict)
elif isinstance(validator, val.Any):
errors += self._validate_any(validator, data, path, strict)
return errors
validator.is_optional and
validator.can_be_none):
return errors
errors += self._validate_primitive(validator, data, path)
if errors:
return errors
if isinstance(validator, val.Include):
errors += self._validate_include(validator, data, path, strict)
elif isinstance(validator, (val.Map, val.List)):
errors += self._validate_map_list(validator, data, path, strict)
elif isinstance(validator, val.Any):
errors += self._validate_any(validator, data, path, strict)
return errors