1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Closes #6423: Cache rendered REST API specifications

This commit is contained in:
jeremystretch
2021-10-01 12:02:04 -04:00
parent ed3bc7cdcc
commit 257c0afdb5
2 changed files with 5 additions and 4 deletions

View File

@ -4,6 +4,7 @@
### Enhancements ### Enhancements
* [#6423](https://github.com/netbox-community/netbox/issues/6423) - Cache rendered REST API specifications
* [#7387](https://github.com/netbox-community/netbox/issues/7387) - Enable arbitrary ordering of custom scripts * [#7387](https://github.com/netbox-community/netbox/issues/7387) - Enable arbitrary ordering of custom scripts
### Bug Fixes ### Bug Fixes

View File

@ -17,7 +17,7 @@ from .admin import admin_site
openapi_info = openapi.Info( openapi_info = openapi.Info(
title="NetBox API", title="NetBox API",
default_version='v2', default_version='v3',
description="API to access NetBox", description="API to access NetBox",
terms_of_service="https://github.com/netbox-community/netbox", terms_of_service="https://github.com/netbox-community/netbox",
license=openapi.License(name="Apache v2 License"), license=openapi.License(name="Apache v2 License"),
@ -59,9 +59,9 @@ _patterns = [
path('api/users/', include('users.api.urls')), path('api/users/', include('users.api.urls')),
path('api/virtualization/', include('virtualization.api.urls')), path('api/virtualization/', include('virtualization.api.urls')),
path('api/status/', StatusView.as_view(), name='api-status'), path('api/status/', StatusView.as_view(), name='api-status'),
path('api/docs/', schema_view.with_ui('swagger'), name='api_docs'), path('api/docs/', schema_view.with_ui('swagger', cache_timeout=86400), name='api_docs'),
path('api/redoc/', schema_view.with_ui('redoc'), name='api_redocs'), path('api/redoc/', schema_view.with_ui('redoc', cache_timeout=86400), name='api_redocs'),
re_path(r'^api/swagger(?P<format>.json|.yaml)$', schema_view.without_ui(), name='schema_swagger'), re_path(r'^api/swagger(?P<format>.json|.yaml)$', schema_view.without_ui(cache_timeout=86400), name='schema_swagger'),
# GraphQL # GraphQL
path('graphql/', csrf_exempt(GraphQLView.as_view(graphiql=True, schema=schema)), name='graphql'), path('graphql/', csrf_exempt(GraphQLView.as_view(graphiql=True, schema=schema)), name='graphql'),