logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Catmandu::Fix::validate - validate data and keep errors

Configuration

       error_field
           Path where to store errors. Set to "errors" by default.

       Additional options are passed to the validator.

Description

       This Catmandu::Fix validates data with a Catmandu::Validator and stores errors in field "errors" for
       further inspection.

Name

       Catmandu::Fix::validate - validate data and keep errors

See Also

       Catmandu::Fix::Condition::valid

perl v5.40.0                                       2025-01-17                       Catmandu::Fix::validate(3pm)

Synopsis

          # 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)

See Also