Browse Source

HOT-FIX: altera inclusão de drf-yasg

Configura urls drf-yasg se ele está presente na lista de apps do projeto
pull/2758/head
Leandro Roberto 6 years ago
parent
commit
cf4c5509d9
  1. 7
      sapl/api/urls.py

7
sapl/api/urls.py

@ -1,7 +1,5 @@
from django.conf import settings from django.conf import settings
from django.conf.urls import include, url from django.conf.urls import include, url
from drf_yasg import openapi
from drf_yasg.views import get_schema_view
from rest_framework import permissions from rest_framework import permissions
from rest_framework.routers import DefaultRouter from rest_framework.routers import DefaultRouter
@ -29,7 +27,10 @@ for app, built_sets in SaplApiViewSetConstrutor._built_sets.items():
urlpatterns_router = router.urls urlpatterns_router = router.urls
urlpatterns_api_doc = []
if 'drf_yasg' in settings.INSTALLED_APPS:
from drf_yasg import openapi
from drf_yasg.views import get_schema_view
schema_view = get_schema_view( schema_view = get_schema_view(
openapi.Info( openapi.Info(
title="Sapl API - docs", title="Sapl API - docs",

Loading…
Cancel
Save