diff --git a/backend/api/schema/__init__.py b/backend/api/schema/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/backend/api/schema/apps.py b/backend/api/schema/apps.py new file mode 100644 index 0000000..5ae8dd7 --- /dev/null +++ b/backend/api/schema/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class ApiConfig(AppConfig): + default_auto_field = "django.db.models.BigAutoField" + name = "api.schema" diff --git a/backend/api/schema/urls.py b/backend/api/schema/urls.py new file mode 100644 index 0000000..a8fe7b0 --- /dev/null +++ b/backend/api/schema/urls.py @@ -0,0 +1,22 @@ +from django.urls import path + +from drf_spectacular.views import ( + SpectacularAPIView, + SpectacularRedocView, + SpectacularSwaggerView, +) + +urlpatterns = [ + path("", SpectacularAPIView.as_view(), name="schema"), + # Optional UI: + path( + "swagger-ui/", + SpectacularSwaggerView.as_view(url_name="schema"), + name="swagger-ui", + ), + path( + "redoc/", + SpectacularRedocView.as_view(url_name="schema"), + name="redoc", + ), +]