ckan / ckan/ckanext-validation
"TypeError: expected string or buffer" when Validation Options are set in config file but not provided in the resource field
- Dominant language
- Python
- Stars
- 30
- Forks
- 33
- PR merge metrics
- No merged PRs in 30d
Description
# Overview
As explained in the [Documentation](https://github.com/frictionlessdata/ckanext-validation#formats-to-validate) I set up a default value for the validation options in the configuration file.
I try to add a resource not providing any input in the resource field for validation options, and this leads to a Server error.

The Server error is "TypeError: expected string or buffer" generated from the following [line of code](https://github.com/frictionlessdata/ckanext-validation/blob/master/ckanext/validation/validators.py#L62).
So this should take into account the case where the value is null.
I've added this as a solution:
`
if value:
provided_options = json.loads(value)
default_options.update(provided_options)
`
This should solve the issue. Should I submit a PR?
---
Please preserve this line to notify @amercader (maintainer of this repository)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.