@classmethod
    def validate_attribute(cls, attr_name, attr):

        if not isinstance(attr, dict):
            return attr

        if 'type' not in attr and 'value' not in attr:
            return attr

        schema = copy.deepcopy(base_types.ATTRIBUTE_SCHEMA)
        type_ = attr.get('type')
        if type_:
            value_schema = base_types.ATTRIBUTE_TYPE_SCHEMAS.get(type_)
            if value_schema:
                schema['properties'].update(value_schema)

        try:
            cls.validate_schema(attr, schema)
        except errors.JsonValidationError as e:
            raise errors.JsonValidationError(
                '[{0}] {1}'.format(attr_name, e.message))

        # Validate regexp only if some value is present
        # Otherwise regexp might be invalid
        if attr['value']:
            regex_err = restrictions.AttributesRestriction.validate_regex(attr)
            if regex_err is not None:
                raise errors.JsonValidationError(
                    '[{0}] {1}'.format(attr_name, regex_err))
Default implementation of mapping the log record into a dict
dataset/ETHPy150Open openstack/fuel-web/nailgun/nailgun/api/v1/validators/base.py/BasicAttributesValidator.validate_attribute--crossover with--dataset/ETHPy150Open azoft-dev-team/imagrium/env/Lib/logging/handlers.py/HTTPHandler.mapLogRecord