def METHOD_NAME(field):
    """
    Given a DJango model field, return the appropriate openapi type.
    """
    internal_type = field.get_internal_type()
    if internal_type == 'AutoField' or internal_type == 'PositiveIntegerField':
        return openapi.TYPE_INTEGER
    elif internal_type == 'CharField' or internal_type == 'TextField':
        return openapi.TYPE_STRING
    elif internal_type == 'DecimalField':
        return openapi.TYPE_NUMBER
    elif internal_type == 'ForeignKey':
        return METHOD_NAME(field.target_field)