Add drf-yasg

* Install drf-yasg

* Add drf-yasg settings and urls

* Pin drf to make drf-yasg work

* Adjust config-models version to be compatible

* Remove django-rest-swagger (the old way)
This commit is contained in:
Ned Batchelder
2019-04-24 15:46:50 -04:00
parent 14f7b90fb8
commit 2e9cae46cb
8 changed files with 43 additions and 11 deletions

22
openedx/core/openapi.py Normal file
View File

@@ -0,0 +1,22 @@
"""
Open API support.
"""
from rest_framework import permissions
from drf_yasg.views import get_schema_view
from drf_yasg import openapi
openapi_info = openapi.Info(
title="Open edX API",
default_version="v1",
description="APIs for access to Open edX information",
#terms_of_service="https://www.google.com/policies/terms/", # TODO: Do we have these?
contact=openapi.Contact(email="oscm@edx.org"),
#license=openapi.License(name="BSD License"), # TODO: What does this mean?
)
schema_view = get_schema_view(
openapi_info,
public=True,
permission_classes=(permissions.AllowAny,),
)