def field2range(field):
    """Return the dictionary of swagger field attributes for a set of
    :class:`Range <marshmallow.validators.Range>` validators.

    :param Field field: A marshmallow field.
    :rtype: dict
    """
    validators = [
        validator for validator in field.validators
        if (
            hasattr(validator, 'min') and
            hasattr(validator, 'max') and
            not hasattr(validator, 'equal')
        )
    ]

    attributes = {}
    for validator in validators:
        if not validator.min is None:
            if hasattr(attributes, 'minimum'):
                attributes['minimum'] = max(
                    attributes['minimum'],
                    validator.min
                )
            else:
                attributes['minimum'] = validator.min
        if not validator.max is None:
            if hasattr(attributes, 'maximum'):
                attributes['maximum'] = min(
                    attributes['maximum'],
                    validator.max
                )
            else:
                attributes['maximum'] = validator.max
    return attributes