- Add OpenAPI tags for the seven API groups and a full description (auth, error envelope, pagination, idempotency) in SPECTACULAR_SETTINGS - Annotate every endpoint with @extend_schema: summary, description, query parameters, request/response examples and error responses - Add shared schema helpers in apps/common/schema.py: ErrorEnvelope, error_responses(), pagination and catalog filter parameters - Document JWT login and token refresh that simplejwt ships without docs - Add ReDoc at /api/redoc/ next to Swagger UI at /api/docs/ - Add export_api_docs management command rendering the schema into a standalone HTML reference (no CDN) and commit docs/api-reference.html - Describe the documentation entry points in docs/architecture.md Schema validates cleanly: 41 operations, 0 warnings.
26 lines
816 B
Python
26 lines
816 B
Python
from django.urls import include, path
|
|
from rest_framework.routers import DefaultRouter
|
|
|
|
from .views import (
|
|
AddressViewSet,
|
|
MeView,
|
|
OtpRequestView,
|
|
OtpVerifyView,
|
|
PasswordSetView,
|
|
PhoneTokenObtainView,
|
|
PhoneTokenRefreshView,
|
|
)
|
|
|
|
router = DefaultRouter()
|
|
router.register("addresses", AddressViewSet, basename="address")
|
|
|
|
urlpatterns = [
|
|
path("otp/request/", OtpRequestView.as_view(), name="otp-request"),
|
|
path("otp/verify/", OtpVerifyView.as_view(), name="otp-verify"),
|
|
path("token/", PhoneTokenObtainView.as_view(), name="token-obtain"),
|
|
path("token/refresh/", PhoneTokenRefreshView.as_view(), name="token-refresh"),
|
|
path("me/", MeView.as_view(), name="me"),
|
|
path("password/", PasswordSetView.as_view(), name="password-set"),
|
|
path("", include(router.urls)),
|
|
]
|