File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 1717# pylint: disable=E1101
1818"""Urlconf for the NAV REST api"""
1919
20- from django .urls import re_path , include
20+ from django .urls import path , re_path , include
21+ from drf_spectacular .views import SpectacularAPIView , SpectacularSwaggerView
2122from rest_framework import routers
2223
2324from nav .auditlog import api as auditlogapi
5455router .register (r'auditlog' , auditlogapi .LogEntryViewSet , basename = 'auditlog' )
5556router .register (r'module' , views .ModuleViewSet , basename = 'module' )
5657
58+ openapi_urls = [
59+ path ('' , SpectacularAPIView .as_view (api_version = "1" ), name = 'schema' ),
60+ path (
61+ "swagger-ui/" ,
62+ SpectacularSwaggerView .as_view (url_name = "api:1:openapi:schema" ),
63+ name = "swagger-ui" ,
64+ ),
65+ ]
5766
5867urlpatterns = [
68+ path ("schema/" , include ((openapi_urls , "openapi" ))),
5969 re_path (r'^$' , views .api_root ),
6070 re_path (r'^token/$' , views .get_or_create_token , name = "token" ),
6171 re_path (r'^version/$' , views .get_nav_version , name = "version" ),
You can’t perform that action at this time.
0 commit comments