Skip to content

Commit

Permalink
Prefetch: Disable on some viewsets due to payload size (#10961)
Browse files Browse the repository at this point in the history
  • Loading branch information
Maffooch authored Sep 26, 2024
1 parent ae39ad9 commit aa872c8
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions dojo/api_v2/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ def get_queryset(self):

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


# Authorization: object-based
@extend_schema_view(**schema_with_prefetch())
# @extend_schema_view(**schema_with_prefetch())
# Nested models with prefetch make the response schema too long for Swagger UI
class EndpointStatusViewSet(
PrefetchDojoModelViewSet,
):
Expand Down Expand Up @@ -382,7 +384,8 @@ def get_queryset(self):


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


@extend_schema_view(**schema_with_prefetch())
# @extend_schema_view(**schema_with_prefetch())
# Nested models with prefetch make the response schema too long for Swagger UI
class RiskAcceptanceViewSet(
PrefetchDojoModelViewSet,
):
Expand Down Expand Up @@ -735,7 +739,8 @@ def get_queryset(self):


# Authorization: configuration
@extend_schema_view(**schema_with_prefetch())
# @extend_schema_view(**schema_with_prefetch())
# Nested models with prefetch make the response schema too long for Swagger UI
class CredentialsMappingViewSet(
PrefetchDojoModelViewSet,
):
Expand Down Expand Up @@ -1475,7 +1480,8 @@ def get_queryset(self):


# Authorization: object-based
@extend_schema_view(**schema_with_prefetch())
# @extend_schema_view(**schema_with_prefetch())
# Nested models with prefetch make the response schema too long for Swagger UI
class JiraIssuesViewSet(
PrefetchDojoModelViewSet,
):
Expand Down Expand Up @@ -1591,7 +1597,8 @@ def get_queryset(self):


# Authorization: object-based
@extend_schema_view(**schema_with_prefetch())
# @extend_schema_view(**schema_with_prefetch())
# Nested models with prefetch make the response schema too long for Swagger UI
class DojoMetaViewSet(
PrefetchDojoModelViewSet,
):
Expand Down Expand Up @@ -1902,7 +1909,8 @@ def partial_update(self, request, pk=None):


# Authorization: object-based
@extend_schema_view(**schema_with_prefetch())
# @extend_schema_view(**schema_with_prefetch())
# Nested models with prefetch make the response schema too long for Swagger UI
class StubFindingsViewSet(
PrefetchDojoModelViewSet,
):
Expand Down Expand Up @@ -1941,7 +1949,8 @@ def get_queryset(self):


# Authorization: object-based
@extend_schema_view(**schema_with_prefetch())
# @extend_schema_view(**schema_with_prefetch())
# Nested models with prefetch make the response schema too long for Swagger UI
class TestsViewSet(
PrefetchDojoModelViewSet,
ra_api.AcceptedRisksMixin,
Expand Down Expand Up @@ -2149,7 +2158,8 @@ def get_queryset(self):
return Test_Type.objects.all().order_by("id")


@extend_schema_view(**schema_with_prefetch())
# @extend_schema_view(**schema_with_prefetch())
# Nested models with prefetch make the response schema too long for Swagger UI
class TestImportViewSet(
PrefetchDojoModelViewSet,
):
Expand Down

0 comments on commit aa872c8

Please sign in to comment.