restapi.models.schema.PartialSchema.validate
- PartialSchema.validate(data, *, many=None, partial=None)
Validate data against the schema, returning a dictionary of validation errors.
- Parameters:
data (
Union[Mapping[str,Any],Iterable[Mapping[str,Any]]]) – The data to validate.many (
bool|None, default:None) – Whether to validate data as a collection. If None, the value for self.many is used.partial (
Union[bool,Sequence[str],AbstractSet[str],None], default:None) – Whether to ignore missing fields and not require any fields declared. Propagates down toNestedfields as well. If its value is an iterable, only missing fields listed in that iterable will be ignored. Use dot delimiters to specify nested fields.
- Return type:
dict[str,list[str]]- Returns:
A dictionary of validation errors.
Added in version 1.1.0.