Add openapi spec for API v2 (#1388)

This commit is contained in:
Kyle Robbertze 2021-10-16 18:34:03 +00:00 committed by GitHub
parent 9f1e41e6fa
commit 1274b2d849
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 104 additions and 11 deletions

View file

@ -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")),
]