Skip to content

Instantly share code, notes, and snippets.

@KimSoungRyoul
Last active April 14, 2021 06:42
Show Gist options
  • Save KimSoungRyoul/c36ca9be803c26a576ed7a14dd11b88a to your computer and use it in GitHub Desktop.
Save KimSoungRyoul/c36ca9be803c26a576ed7a14dd11b88a to your computer and use it in GitHub Desktop.
# urls.py
from drf_spectacular.views import SpectacularJSONAPIView
from drf_spectacular.views import SpectacularRedocView
from drf_spectacular.views import SpectacularSwaggerView
from drf_spectacular.views import SpectacularYAMLAPIView
urlpatterns = [
# Open API 자체를 조회 : json, yaml,
path("docs/json/", SpectacularJSONAPIView.as_view(), name="schema-json"),
path("docs/yaml/", SpectacularYAMLAPIView.as_view(), name="swagger-yaml"),
# Open API Document UI로 조회: Swagger, Redoc
path("docs/swagger/", SpectacularSwaggerView.as_view(url_name="schema-json"), name="swagger-ui",),
path("docs/redoc/", SpectacularRedocView.as_view(url_name="schema-json"), name="redoc",),
# ...
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment