def _validate_optional_key(key, missing, value, validated, optional):
    """Validate an optional key."""
    try:
        validated[key] = optional[key](value)
    except NotValid as ex:
        return ['%r: %s' % (key, arg) for arg in ex.args]
    if key in missing:
        missing.remove(key)
    return []