Misc
validate_by_schema(context, data_dict, default_schema)
ΒΆ
Validate the data_dict against a schema. If a schema is not available in the context (under the key 'schema') then the default schema is used.
If the data_dict fails the validation process a ValidationError is raised, otherwise the potentially updated data_dict is returned.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
context
|
the ckan context dict |
required | |
data_dict
|
the dict to validate |
required | |
default_schema
|
the default schema to use if the context doesn't have one |
required |
Source code in ckantools/validators/misc.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | |