From ed0992e999c0d09db2f95dea65174f385be474ee Mon Sep 17 00:00:00 2001 From: mohsentaba Date: Sun, 28 Jun 2026 15:20:59 +0330 Subject: [PATCH] swagger added --- apps/hadis/views/hadis.py | 16 ++++++++++++++++ apps/hadis/views/transmitter.py | 8 ++++++++ 2 files changed, 24 insertions(+) diff --git a/apps/hadis/views/hadis.py b/apps/hadis/views/hadis.py index cedd873..92555c2 100644 --- a/apps/hadis/views/hadis.py +++ b/apps/hadis/views/hadis.py @@ -863,6 +863,14 @@ class HadisCorrectionDetailView(RetrieveAPIView): lookup_url_kwarg = 'correction_slug' permission_classes = [AllowAny] + @swagger_auto_schema( + operation_summary="Get Hadis Correction Detail", + operation_description="Returns the full details of a specific hadis correction, including text, translations, and its book references.", + tags=['Dobodbi - Hadis (V2)'], + ) + def get(self, request, *args, **kwargs): + return super().get(request, *args, **kwargs) + def get_queryset(self): return HadisCorrection.objects.all().select_related( 'hadis' @@ -880,6 +888,14 @@ class HadisInterpretationDetailView(RetrieveAPIView): lookup_url_kwarg = 'interpretation_slug' permission_classes = [AllowAny] + @swagger_auto_schema( + operation_summary="Get Hadis Interpretation Detail", + operation_description="Returns the full details of a specific hadis interpretation, including text, translations, and its book references.", + tags=['Dobodbi - Hadis (V2)'], + ) + def get(self, request, *args, **kwargs): + return super().get(request, *args, **kwargs) + def get_queryset(self): return HadisInterpretation.objects.all().select_related( 'category' diff --git a/apps/hadis/views/transmitter.py b/apps/hadis/views/transmitter.py index 523b188..53880c0 100644 --- a/apps/hadis/views/transmitter.py +++ b/apps/hadis/views/transmitter.py @@ -464,6 +464,14 @@ class TransmitterOriginalTextDetailView(RetrieveAPIView): lookup_url_kwarg = 'original_text_slug' permission_classes = [AllowAny] + @swagger_auto_schema( + operation_summary="Get Original Text Detail", + operation_description="Returns the full details of a specific original text belonging to a narrator, including its content, translations, and book references.", + tags=['Dobodbi - Hadis (V2)'], + ) + def get(self, request, *args, **kwargs): + return super().get(request, *args, **kwargs) + def get_queryset(self): return TransmitterOriginalText.objects.all().select_related( 'transmitter'