Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix OpenAPI and Swagger URLs and CORS #802

Merged
merged 1 commit into from
Oct 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions docker-app/qfieldcloud/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,19 @@
name="index",
),
path(
"schema/",
"swagger.yaml",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's not considered a good practice to use file extensions in urls, for the sake of not being hostage of an extension. But I am no expert in these conventions.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it depends. For the sake of backwards compatibility, it should have the extension for now.

SpectacularAPIView.as_view(),
name="schema",
name="openapi_schema",
),
path(
"swagger/",
SpectacularSwaggerView.as_view(url_name="schema"),
name="schema-swagger-ui",
suricactus marked this conversation as resolved.
Show resolved Hide resolved
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/<uuid:projectid>/",
Expand All @@ -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()),
Expand Down
Loading