-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace drf-yasg with drf-spectacular (#437)
* fix: move to drf-spectacular
- Loading branch information
1 parent
59cffcf
commit 28fefe8
Showing
10 changed files
with
81 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,15 @@ | ||
from django.urls import include, path, re_path | ||
from drf_yasg.views import get_schema_view | ||
from drf_yasg import openapi | ||
from rest_framework import permissions | ||
from drf_spectacular.views import SpectacularAPIView, SpectacularRedocView, SpectacularSwaggerView | ||
|
||
import notesserver.views | ||
|
||
schema_view = get_schema_view( | ||
openapi.Info( | ||
title="Edx Notes API", | ||
default_version='v1', | ||
description="Edx Notes API docs", | ||
), | ||
public=False, | ||
permission_classes=[permissions.AllowAny], | ||
) | ||
|
||
urlpatterns = [ | ||
path('heartbeat/', notesserver.views.heartbeat, name='heartbeat'), | ||
path('selftest/', notesserver.views.selftest, name='selftest'), | ||
re_path(r'^robots.txt$', notesserver.views.robots, name='robots'), | ||
path('', notesserver.views.root, name='root'), | ||
path('api/', include('notesapi.urls', namespace='api')), | ||
path('swagger/', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'), | ||
path('api/schema/', SpectacularAPIView.as_view(), name='schema'), | ||
path('api/schema/swagger-ui/', SpectacularSwaggerView.as_view(url_name='schema'), name='swagger-ui'), | ||
path('api/schema/redoc/', SpectacularRedocView.as_view(url_name='schema'), name='redoc'), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters