Skip to content

Commit fb41238

Browse files
authored
Prefetch: Disable on some viewsets due to payload size (#10961)
1 parent 079bc89 commit fb41238

1 file changed

Lines changed: 19 additions & 9 deletions

File tree

dojo/api_v2/views.py

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ def get_queryset(self):
298298

299299
# Authorization: object-based
300300
# @extend_schema_view(**schema_with_prefetch())
301+
# Nested models with prefetch make the response schema too long for Swagger UI
301302
class EndPointViewSet(
302303
PrefetchDojoModelViewSet,
303304
):
@@ -353,7 +354,8 @@ def generate_report(self, request, pk=None):
353354

354355

355356
# Authorization: object-based
356-
@extend_schema_view(**schema_with_prefetch())
357+
# @extend_schema_view(**schema_with_prefetch())
358+
# Nested models with prefetch make the response schema too long for Swagger UI
357359
class EndpointStatusViewSet(
358360
PrefetchDojoModelViewSet,
359361
):
@@ -382,7 +384,8 @@ def get_queryset(self):
382384

383385

384386
# Authorization: object-based
385-
@extend_schema_view(**schema_with_prefetch())
387+
# @extend_schema_view(**schema_with_prefetch())
388+
# Nested models with prefetch make the response schema too long for Swagger UI
386389
class EngagementViewSet(
387390
PrefetchDojoModelViewSet,
388391
ra_api.AcceptedRisksMixin,
@@ -636,7 +639,8 @@ def download_file(self, request, file_id, pk=None):
636639
return generate_file_response(file_object)
637640

638641

639-
@extend_schema_view(**schema_with_prefetch())
642+
# @extend_schema_view(**schema_with_prefetch())
643+
# Nested models with prefetch make the response schema too long for Swagger UI
640644
class RiskAcceptanceViewSet(
641645
PrefetchDojoModelViewSet,
642646
):
@@ -735,7 +739,8 @@ def get_queryset(self):
735739

736740

737741
# Authorization: configuration
738-
@extend_schema_view(**schema_with_prefetch())
742+
# @extend_schema_view(**schema_with_prefetch())
743+
# Nested models with prefetch make the response schema too long for Swagger UI
739744
class CredentialsMappingViewSet(
740745
PrefetchDojoModelViewSet,
741746
):
@@ -1475,7 +1480,8 @@ def get_queryset(self):
14751480

14761481

14771482
# Authorization: object-based
1478-
@extend_schema_view(**schema_with_prefetch())
1483+
# @extend_schema_view(**schema_with_prefetch())
1484+
# Nested models with prefetch make the response schema too long for Swagger UI
14791485
class JiraIssuesViewSet(
14801486
PrefetchDojoModelViewSet,
14811487
):
@@ -1591,7 +1597,8 @@ def get_queryset(self):
15911597

15921598

15931599
# Authorization: object-based
1594-
@extend_schema_view(**schema_with_prefetch())
1600+
# @extend_schema_view(**schema_with_prefetch())
1601+
# Nested models with prefetch make the response schema too long for Swagger UI
15951602
class DojoMetaViewSet(
15961603
PrefetchDojoModelViewSet,
15971604
):
@@ -1902,7 +1909,8 @@ def partial_update(self, request, pk=None):
19021909

19031910

19041911
# Authorization: object-based
1905-
@extend_schema_view(**schema_with_prefetch())
1912+
# @extend_schema_view(**schema_with_prefetch())
1913+
# Nested models with prefetch make the response schema too long for Swagger UI
19061914
class StubFindingsViewSet(
19071915
PrefetchDojoModelViewSet,
19081916
):
@@ -1941,7 +1949,8 @@ def get_queryset(self):
19411949

19421950

19431951
# Authorization: object-based
1944-
@extend_schema_view(**schema_with_prefetch())
1952+
# @extend_schema_view(**schema_with_prefetch())
1953+
# Nested models with prefetch make the response schema too long for Swagger UI
19451954
class TestsViewSet(
19461955
PrefetchDojoModelViewSet,
19471956
ra_api.AcceptedRisksMixin,
@@ -2149,7 +2158,8 @@ def get_queryset(self):
21492158
return Test_Type.objects.all().order_by("id")
21502159

21512160

2152-
@extend_schema_view(**schema_with_prefetch())
2161+
# @extend_schema_view(**schema_with_prefetch())
2162+
# Nested models with prefetch make the response schema too long for Swagger UI
21532163
class TestImportViewSet(
21542164
PrefetchDojoModelViewSet,
21552165
):

0 commit comments

Comments
 (0)