From d173f9f863b663020ce8759bf056d2bee070658e Mon Sep 17 00:00:00 2001 From: Michael Price Date: Tue, 13 Mar 2018 16:26:50 -0400 Subject: [PATCH] Disable the root API path as this confuses Swagger which then groups all endpoints into a single dropdown. Signed-off-by: Michael Price --- mayan/apps/rest_api/apps.py | 2 +- mayan/apps/rest_api/urls.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/mayan/apps/rest_api/apps.py b/mayan/apps/rest_api/apps.py index 130466c8f5..8c963307ea 100644 --- a/mayan/apps/rest_api/apps.py +++ b/mayan/apps/rest_api/apps.py @@ -21,7 +21,7 @@ class RESTAPIApp(MayanAppConfig): from .urls import api_urls settings.STRONGHOLD_PUBLIC_URLS += (r'^/%s/.+$' % self.app_url,) - menu_tools.bind_links(links=(link_api, link_api_documentation)) + menu_tools.bind_links(links=(link_api_documentation,)) for app in apps.get_app_configs(): if getattr(app, 'has_rest_api', False): diff --git a/mayan/apps/rest_api/urls.py b/mayan/apps/rest_api/urls.py index 33a3a7bed8..fbf56fb369 100644 --- a/mayan/apps/rest_api/urls.py +++ b/mayan/apps/rest_api/urls.py @@ -6,7 +6,11 @@ from .api_views import APIRoot, BrowseableObtainAuthToken api_urls = [ - url(r'^$', APIRoot.as_view(), name='api_root'), + # FIXME: Defining a root API path confuses Swagger which then + # groups all endpoints into a single dropdown. Disable until a + # workaround is found for Swagger. + + # url(r'^$', APIRoot.as_view(), name='api_root'), url( r'^auth/token/obtain/$', BrowseableObtainAuthToken.as_view(), name='auth_token_obtain'