Add 'generate_swagger' management command (#31)

Closes #29.
This commit is contained in:
Beau Gunderson
2017-12-27 11:00:24 -08:00
committed by Cristi Vîjdea
parent 9f14114520
commit 1f190744cd
18 changed files with 408 additions and 107 deletions
+2
View File
@@ -107,6 +107,8 @@ SWAGGER_SETTINGS = {
'LOGIN_URL': '/admin/login',
'LOGOUT_URL': '/admin/logout',
'VALIDATOR_URL': 'http://localhost:8189',
'DEFAULT_INFO': 'testproj.urls.swagger_info'
}
# Internationalization
+9 -8
View File
@@ -6,15 +6,16 @@ from rest_framework.decorators import api_view
from drf_yasg import openapi
from drf_yasg.views import get_schema_view
swagger_info = openapi.Info(
title="Snippets API",
default_version='v1',
description="Test description",
terms_of_service="https://www.google.com/policies/terms/",
contact=openapi.Contact(email="contact@snippets.local"),
license=openapi.License(name="BSD License"),
)
SchemaView = get_schema_view(
openapi.Info(
title="Snippets API",
default_version='v1',
description="Test description",
terms_of_service="https://www.google.com/policies/terms/",
contact=openapi.Contact(email="contact@snippets.local"),
license=openapi.License(name="BSD License"),
),
validators=['ssv', 'flex'],
public=True,
permission_classes=(permissions.AllowAny,),