From 2fcfed8c2b31ec3febc3807fcd6d4f9e82b8fbdd Mon Sep 17 00:00:00 2001 From: Ivan Ivanov Date: Wed, 4 Oct 2023 22:31:26 +0300 Subject: [PATCH] Fix OpenAPI and Swagger URLs and CORS --- docker-app/qfieldcloud/urls.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docker-app/qfieldcloud/urls.py b/docker-app/qfieldcloud/urls.py index a89fd6169..66680429f 100644 --- a/docker-app/qfieldcloud/urls.py +++ b/docker-app/qfieldcloud/urls.py @@ -42,14 +42,19 @@ name="index", ), path( - "schema/", + "swagger.yaml", SpectacularAPIView.as_view(), - name="schema", + name="openapi_schema", ), path( "swagger/", - SpectacularSwaggerView.as_view(url_name="schema"), - name="schema-swagger-ui", + SpectacularSwaggerView.as_view(url_name="openapi_schema"), + name="openapi_swaggerui", + ), + path( + "docs/", + SpectacularRedocView.as_view(url_name="openapi_schema"), + name="openapi_redoc", ), path( settings.QFIELDCLOUD_ADMIN_URI + "api/files//", @@ -65,11 +70,6 @@ name="project_file_download", ), path(settings.QFIELDCLOUD_ADMIN_URI, admin.site.urls), - path( - "docs/", - SpectacularRedocView.as_view(url_name="schema"), - name="schema-redoc", - ), path("api/v1/auth/login/", auth_views.LoginView.as_view()), path("api/v1/auth/token/", auth_views.LoginView.as_view()), path("api/v1/auth/user/", auth_views.UserView.as_view()),