Add openapi spec for API v2 (#1388)
This commit is contained in:
parent
9f1e41e6fa
commit
1274b2d849
7 changed files with 104 additions and 11 deletions
|
@ -1,4 +1,5 @@
|
|||
from django.urls import include, path
|
||||
from drf_spectacular.views import SpectacularAPIView, SpectacularSwaggerView
|
||||
from rest_framework import routers
|
||||
|
||||
from .views import *
|
||||
|
@ -46,6 +47,12 @@ router.register("track-types", TrackTypeViewSet)
|
|||
|
||||
urlpatterns = [
|
||||
path("api/v2/", include(router.urls)),
|
||||
path("api/v2/schema/", SpectacularAPIView.as_view(), name="schema"),
|
||||
path(
|
||||
"api/v2/schema/swagger-ui/",
|
||||
SpectacularSwaggerView.as_view(url_name="schema"),
|
||||
name="swagger-ui",
|
||||
),
|
||||
path("api/v2/version/", version),
|
||||
path("api-auth/", include("rest_framework.urls", namespace="rest_framework")),
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue