Catmandu::Fix::validate
validate data and keep errors
- Provided by: libcatmandu-perl (Version: 1.1000-2)
- Report a bug
validate data and keep errors
# Check author field against a JSON Schema
validate('author', JSONSchema, schema: 'my/schema.json')
if exists(errors)
... # do something
end
# Check item against a custom validator, store in errors in 'warnings'
validate('author', MyValidatorClass, error_field: warnings)
This Catmandu::Fix validates data with a Catmandu::Validator and stores errors in field "errors" for further inspection.
Additional options are passed to the validator.
Catmandu::Fix::Condition::valid