Read the docs for Attribute::Params::Validate which is part of the Params-Validate package. It will do just what you want.
You'll need to wait for the next release of OIO (v2.25), however. I need to make a small change so that you can use Attribute::Params::Validate.
One issue I've noticed so far is that some OIO attributes (e.g., :Restricted) will be incompatible with Attribute::Params::Validate. I'll try to document this in the POD.
(2)
]
