I'm documenting my Django application using get_schema_view()
method, but when I open the Swagger UI all the URLs are placed under the same group.
My urls.py look like:
router = routers.DefaultRouter()
router.register(r'stores', StoreViewSet)
urlpatterns = [
path('admin/', admin.site.urls),
path('api/', include(router.urls)),
path('api/register/', UserRegistrationView.as_view(), name='register'),
path('api/login/', views.obtain_auth_token, name='login'),
# Documentation
path('openapi/', get_schema_view(
title='Title API',
description='Some description goes here...',
version='v0.1'
), name='openapi-schema'),
path('docs/', TemplateView.as_view(
template_name='documentation.html',
extra_context={'schema_url': 'openapi-schema'}
), name='docs')
]
All the endpoints are placed under a group called api in the Swagger UI.
How can I specify the api/
prefix while generating the schema in order to group the endpoints by model?
Thanks.