Catman...alidate(3pm)
π NAME π
Catmandu::Fix::validate β bestie, this one validates your data and keeps the receipts (aka the errors) π₯
β¨ 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)
Okay so literally just look at that second one β you can yeet your error messages into a field of your choosing, no biggie, we love a customizable queen π
π¦ DESCRIPTION π¦
So here's the vibe: this Catmandu::Fix runs your data through a Catmandu::Validator and then β and this is the important part, bestie β it stores the errors in a field called errors so you can go back and inspect them later. No cap. It doesn't just silently fail on you, it tells you what went wrong and leaves a lil note π
π CONFIGURATION π
error_fieldβ the path where you wanna stash those errors. Defaults toerrors, so if you don't say anything, that's where they're gonna live, periodt.
Also: any extra options you throw at this thing get passed straight through to the validator, so go wild π«Ά
π SEE ALSO π
Catmandu::Fix::Condition::validβ your other fave, go check it out, iykyk π
mwah π this page is riding with perl v5.40.1, dated 2026-01-24, and it's a Catman...alidate(3pm) moment fr fr β go validate something iconic bestie β¨π¦πΈ
π¦ where this page comes from
- ubuntu resolute: libcatmandu-perl 1.2025-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcatmandu-perl 1.2025-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms