parent
26ddb10fa6
commit
c1e552aec7
1 changed files with 29 additions and 0 deletions
@ -0,0 +1,29 @@ |
||||
from django.urls import path, include |
||||
|
||||
from rest_framework import permissions |
||||
from rest_framework.routers import DefaultRouter |
||||
|
||||
from drf_yasg.views import get_schema_view |
||||
from drf_yasg import openapi |
||||
|
||||
|
||||
router = DefaultRouter() |
||||
|
||||
|
||||
schema_view = get_schema_view( |
||||
openapi.Info( |
||||
title="Lil Sity API", |
||||
default_version='v1', |
||||
description="Routes of Lil City project", |
||||
), |
||||
validators=['flex', 'ssv'], |
||||
public=False, |
||||
permission_classes=(permissions.AllowAny,), |
||||
) |
||||
|
||||
urlpatterns = [ |
||||
path('swagger(<str:format>.json|.yaml)', schema_view.without_ui(cache_timeout=None), name='schema-json'), |
||||
path('swagger/', schema_view.with_ui('swagger', cache_timeout=None), name='schema-swagger-ui'), |
||||
path('redoc/', schema_view.with_ui('redoc', cache_timeout=None), name='schema-redoc'), |
||||
path('', include((router.urls, 'api-root')), name='api-root') |
||||
] |
||||
Loading…
Reference in new issue