def field2read_only(field, **kwargs):
    """Return the dictionary of swagger field attributes for a dump_only field.

    :param Field field: A marshmallow field.
    :rtype: dict
    """
    attributes = {}
    if field.dump_only:
        attributes['readOnly'] = True
    return attributes
