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:
22
openedx/core/openapi.py
Normal file
22
openedx/core/openapi.py
Normal 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,),
|
||||
)
|
||||
Reference in New Issue
Block a user