marcgibbons / django-rest-swagger

Swagger Documentation Generator for Django REST Framework: deprecated
https://marcgibbons.com/django-rest-swagger/
BSD 2-Clause "Simplified" License
2.59k stars 602 forks source link

Versioned API, Swagger UI ignores groupings #715

Open fablet opened 6 years ago

fablet commented 6 years ago

I'm working with a versioned api calling and rendering the Swagger documentation with get_swagger_view

url(r'^api/swagger/', get_swagger_view(title='SEED API'), name='swagger'),

I can see that the schema created in get_swagger_view is creating groupings per version.

 v1: {
        columns: {
            list()
            get_default_columns()
        }
        delete_organization_inventory: {
            delete()
        }
        get_default_building_detail_columns: {
            list()
        }
        search_buildings: {
            create()
        }
        set_default_building_detail_columns: {
            create()
        }
        set_default_columns: {
            create()
        }
    }
    v2: {
        column_mappings: {
            list()
            delete_all()
            read(id)
        }
        columns: {
            list()
            delete_all()
            retrieve_all()
            read(id)
        }
        cycles: {
            list([page], [name], [start_lte], [end_gte], [year])
            create(name, start, end)
            read(id)
            update(id, name, start, end)
            partial_update(id, [name], [start], [end])
            delete(id)
        }
        data_quality_checks: {
            create()
            data_quality_rules()
            reset_all_data_quality_rules()
            reset_default_data_quality_rules()
            save_data_quality_rules()
            csv(id)
        }
        datasets: {
            list()
            create()
            count()
            read(id)
            update(id)
            delete(id)
        }
}

However, the UI is only honoring the top level grouping, the versions, v1, v2, etc, and ignores the grouping within versions, columns, cycles, etc.

screenshot from swagger

ghost commented 6 years ago

Can't believe it same issue after so much time. I have fight with this whole week, did you manage to fix it?

aindong commented 6 years ago

same issue here