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

    :param Field field: A marshmallow field.
    :rtype: dict
    """
    attributes = {}
    if field.load_only and kwargs['openapi_major_version'] >= 3:
        attributes['writeOnly'] = True
    return attributes