Skip to content

Commit 257c0af

Browse files
committed
Closes #6423: Cache rendered REST API specifications
1 parent ed3bc7c commit 257c0af

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

docs/release-notes/version-3.0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### Enhancements
66

7+
* [#6423](https://github.com/netbox-community/netbox/issues/6423) - Cache rendered REST API specifications
78
* [#7387](https://github.com/netbox-community/netbox/issues/7387) - Enable arbitrary ordering of custom scripts
89

910
### Bug Fixes

netbox/netbox/urls.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
openapi_info = openapi.Info(
1919
title="NetBox API",
20-
default_version='v2',
20+
default_version='v3',
2121
description="API to access NetBox",
2222
terms_of_service="https://github.com/netbox-community/netbox",
2323
license=openapi.License(name="Apache v2 License"),
@@ -59,9 +59,9 @@
5959
path('api/users/', include('users.api.urls')),
6060
path('api/virtualization/', include('virtualization.api.urls')),
6161
path('api/status/', StatusView.as_view(), name='api-status'),
62-
path('api/docs/', schema_view.with_ui('swagger'), name='api_docs'),
63-
path('api/redoc/', schema_view.with_ui('redoc'), name='api_redocs'),
64-
re_path(r'^api/swagger(?P<format>.json|.yaml)$', schema_view.without_ui(), name='schema_swagger'),
62+
path('api/docs/', schema_view.with_ui('swagger', cache_timeout=86400), name='api_docs'),
63+
path('api/redoc/', schema_view.with_ui('redoc', cache_timeout=86400), name='api_redocs'),
64+
re_path(r'^api/swagger(?P<format>.json|.yaml)$', schema_view.without_ui(cache_timeout=86400), name='schema_swagger'),
6565

6666
# GraphQL
6767
path('graphql/', csrf_exempt(GraphQLView.as_view(graphiql=True, schema=schema)), name='graphql'),

0 commit comments

Comments
 (0)