from drf_yasg.utils import swagger_auto_schema from drf_yasg import openapi from rest_framework import status # Swagger documentation for HadisSectListView hadis_sect_list_swagger = swagger_auto_schema( operation_description="Get list of all active Hadis sects grouped by sect type (Shia/Sunni)", operation_summary="List Hadis Sects", tags=['Hadis'], responses={ status.HTTP_200_OK: openapi.Response( description="List of hadis sects grouped by type with count", examples={ "application/json": { "count": 4, "results": { "shia": [ { "id": 1, "title": "Twelver Shia", "seo_field": None }, { "id": 2, "title": "Ismaili Shia", "seo_field": None } ], "sunni": [ { "id": 3, "title": "Hanafi", "seo_field": None }, { "id": 4, "title": "Maliki", "seo_field": None } ] } } } ), status.HTTP_500_INTERNAL_SERVER_ERROR: openapi.Response( description="Internal server error" ) } ) # Swagger documentation for HadisCategoryTreeView hadis_category_tree_swagger = swagger_auto_schema( operation_description="Get complete hierarchical tree structure of Hadis categories grouped by sect type (shia/sunni), with enhanced child information including father category details and hadis information", operation_summary="Get Complete Hadis Category Tree", tags=['Hadis'], responses={ status.HTTP_200_OK: openapi.Response( description="Complete hierarchical tree structure of categories grouped by sect type with enhanced child information", examples={ "application/json": { "count": 12, "results": { "shia": { "sects": { "1": { "id": 1, "sect_type": "shia", "title": "Shi'a Hadith Collections", "description": "Collections of Shi'a hadith", "order": 1 } }, "categories": { "quran": [ { "id": 1, "name": "Tafsir", "hadis_count": 150, "has_hadis": False, "order": 1, "xmind_file": "http://example.com/media/xmind/tafsir.xmind", "has_xmind_file": True, "children": [ { "id": 2, "name": "Surah Al-Fatiha", "hadis_count": 25, "has_hadis": True, "order": 1, "father_category": { "id": 1, "name": "Tafsir", "sect_id": 1, "sect_type": "shia", "source_type": "quran" }, "hadis_details": [ { "id": 1, "title": "The Opening", "title_narrator": "From Abu Hurairah", "text": "Actions are but by intention...", "translation": "Actions are but by intention...", "share_link": "http://example.com/hadis/1" } ], "children": [] } ] } ], "hadith": [] } }, "sunni": { "sects": { "2": { "id": 2, "sect_type": "sunni", "title": "Sunni Hadith Collections", "description": "Collections of Sunni hadith", "order": 2 } }, "categories": { "hadith": [ { "id": 10, "name": "Sahih al-Bukhari", "hadis_count": 2500, "has_hadis": True, "hadis_details": [ { "id": 100, "title": "The Beginning of Revelation", "title_narrator": "From Aisha", "text": "The first revelation...", "translation": "The first revelation...", "share_link": "http://example.com/hadis/100" } ], "children": [] } ] } } } } } ), status.HTTP_500_INTERNAL_SERVER_ERROR: openapi.Response( description="Internal server error" ) } ) # Swagger documentation for HadisSyncView # Swagger documentation for HadisListView hadis_list_swagger = swagger_auto_schema( operation_description=""" Retrieve a paginated list of Hadis (traditions) for a specific category. **Key Features:** - Returns hadis entries filtered by category ID - Supports pagination for large datasets - Translations are automatically provided based on the Accept-Language header - Each hadis includes its category information, title, narrator, Arabic text, and translation **Usage:** - Use this endpoint to browse hadis within a specific category - The response includes pagination links (next/previous) for navigation - Set the Accept-Language header to get translations in your preferred language (en, fa, ar, ur) - Only active (status=True) hadis are returned **Response Structure:** - `count`: Total number of hadis in the category - `next`: URL for the next page (null if on last page) - `previous`: URL for the previous page (null if on first page) - `results`: Array of hadis objects with full details """, operation_summary="List Hadis by Category", tags=['Hadis'], manual_parameters=[ openapi.Parameter( 'category_id', openapi.IN_PATH, description="Unique identifier of the Hadis category. Must be a valid category ID that exists in the system.", type=openapi.TYPE_INTEGER, required=True, example=1 ), openapi.Parameter( 'page', openapi.IN_QUERY, description="Page number for pagination. Starts from 1. If not provided, returns the first page.", type=openapi.TYPE_INTEGER, required=False, example=1 ), openapi.Parameter( 'Accept-Language', openapi.IN_HEADER, description="Language code for translations. Supported codes: 'en' (English), 'fa' (Persian), 'ar' (Arabic), 'ur' (Urdu). Defaults to 'en' if not specified.", type=openapi.TYPE_STRING, required=False, default='en', enum=['en', 'fa', 'ar', 'ur'] ) ], responses={ status.HTTP_200_OK: openapi.Response( description="Successfully retrieved paginated list of hadis for the specified category", examples={ "application/json": { "count": 150, "next": "http://example.com/api/hadis/category/1/?page=2", "previous": None, "results": [ { "id": 1, "number": 1, "title": "The Opening", "title_narrator": "From Abu Hurairah", "text": "إنما الأعمال بالنيات وإنما لكل امرئ ما نوى", "translation": "Actions are but by intention, and every man shall have only what he intended", "category": { "id": 1, "title": "Book of Faith", "slug": "book-of-faith", "source_type": "hadith", "sect_type": "sunni" }, "share_link": "http://example.com/hadis/1" }, { "id": 2, "number": 2, "title": "The Second Hadith", "title_narrator": "From Umar ibn al-Khattab", "text": "بينما نحن عند رسول الله صلى الله عليه وسلم ذات يوم", "translation": "While we were sitting with the Messenger of Allah (peace be upon him) one day", "category": { "id": 1, "title": "Book of Faith", "slug": "book-of-faith", "source_type": "hadith", "sect_type": "sunni" }, "share_link": "http://example.com/hadis/2" } ] } } ), status.HTTP_404_NOT_FOUND: openapi.Response( description="The specified category ID does not exist or the category has no active hadis", examples={ "application/json": { "detail": "Not found." } } ), status.HTTP_500_INTERNAL_SERVER_ERROR: openapi.Response( description="Internal server error occurred while processing the request" ) } ) hadis_basic_swagger = swagger_auto_schema( operation_description="Get basic information about a specific hadis including core text and translation", operation_summary="Get Hadis Basic Info", operation_id="getHadisBasic", tags=['Hadis'], manual_parameters=[ openapi.Parameter( 'hadis_id', openapi.IN_PATH, description="ID of the hadis", type=openapi.TYPE_INTEGER, required=True ) ], responses={ status.HTTP_200_OK: openapi.Response( description="Basic hadis information", examples={ "application/json": { "id": 1, "title": "The Opening", "title_narrator": "From Abu Hurairah", "text": "Actions are but by intention...", "translation": "Actions are but by intention...", "share_link": "http://example.com/hadis/1", 'explanation': "This hadith emphasizes the importance of intention in all actions...", } } ), status.HTTP_404_NOT_FOUND: openapi.Response( description="Hadis not found" ), status.HTTP_500_INTERNAL_SERVER_ERROR: openapi.Response( description="Internal server error" ) } ) hadis_detail_swagger = swagger_auto_schema( operation_summary="Get Hadis Full Details", operation_description="Retrieve detailed information about a specific hadis including status, tags, and references (transmitters and corrections moved to separate endpoints)", tags=['Hadis'], responses={ 200: openapi.Response( description="Hadis details retrieved successfully", schema=openapi.Schema( type=openapi.TYPE_OBJECT, properties={ 'id': openapi.Schema(type=openapi.TYPE_INTEGER, description='Hadis ID'), 'number': openapi.Schema(type=openapi.TYPE_INTEGER, description='Hadis number'), 'title': openapi.Schema(type=openapi.TYPE_STRING, description='Hadis title'), 'text': openapi.Schema(type=openapi.TYPE_STRING, description='Arabic text of hadis'), 'translation': openapi.Schema(type=openapi.TYPE_STRING, description='Translation in request language'), 'explanation': openapi.Schema(type=openapi.TYPE_STRING, description='Detailed explanation'), 'address': openapi.Schema(type=openapi.TYPE_STRING, description='Source address'), 'hadis_status_text': openapi.Schema(type=openapi.TYPE_STRING, description='Status description'), 'links': openapi.Schema( type=openapi.TYPE_ARRAY, items=openapi.Schema( type=openapi.TYPE_OBJECT, properties={ 'title': openapi.Schema(type=openapi.TYPE_STRING), 'link': openapi.Schema(type=openapi.TYPE_STRING) } ), description='Related links' ), 'status': openapi.Schema(type=openapi.TYPE_BOOLEAN, description='Active status'), 'category': openapi.Schema( type=openapi.TYPE_OBJECT, properties={ 'id': openapi.Schema(type=openapi.TYPE_INTEGER), 'title': openapi.Schema(type=openapi.TYPE_STRING), 'category_type': openapi.Schema(type=openapi.TYPE_STRING) } ), 'hadis_status': openapi.Schema( type=openapi.TYPE_OBJECT, properties={ 'id': openapi.Schema(type=openapi.TYPE_INTEGER), 'title': openapi.Schema(type=openapi.TYPE_STRING), 'color': openapi.Schema(type=openapi.TYPE_STRING) } ), 'tags': openapi.Schema( type=openapi.TYPE_ARRAY, items=openapi.Schema( type=openapi.TYPE_OBJECT, properties={ 'id': openapi.Schema(type=openapi.TYPE_INTEGER), 'title': openapi.Schema(type=openapi.TYPE_STRING) } ) ), 'transmitters': openapi.Schema( type=openapi.TYPE_ARRAY, items=openapi.Schema( type=openapi.TYPE_OBJECT, properties={ 'id': openapi.Schema(type=openapi.TYPE_INTEGER), 'order': openapi.Schema(type=openapi.TYPE_INTEGER), 'is_gap': openapi.Schema(type=openapi.TYPE_BOOLEAN), 'transmitter': openapi.Schema( type=openapi.TYPE_OBJECT, properties={ 'id': openapi.Schema(type=openapi.TYPE_INTEGER), 'full_name': openapi.Schema(type=openapi.TYPE_STRING), 'birth_year_hijri': openapi.Schema(type=openapi.TYPE_INTEGER), 'death_year_hijri': openapi.Schema(type=openapi.TYPE_INTEGER), 'description': openapi.Schema(type=openapi.TYPE_STRING) } ) } ) ), 'references': openapi.Schema( type=openapi.TYPE_ARRAY, items=openapi.Schema( type=openapi.TYPE_OBJECT, properties={ 'id': openapi.Schema(type=openapi.TYPE_INTEGER), 'page_number': openapi.Schema(type=openapi.TYPE_STRING), 'hadis_number_in_book': openapi.Schema(type=openapi.TYPE_STRING), 'description': openapi.Schema(type=openapi.TYPE_STRING), 'book': openapi.Schema( type=openapi.TYPE_OBJECT, properties={ 'id': openapi.Schema(type=openapi.TYPE_INTEGER), 'title': openapi.Schema(type=openapi.TYPE_STRING), 'summary_title': openapi.Schema(type=openapi.TYPE_STRING), 'publisher': openapi.Schema(type=openapi.TYPE_STRING), 'year_of_publication': openapi.Schema(type=openapi.TYPE_STRING) } ), 'images': openapi.Schema( type=openapi.TYPE_ARRAY, items=openapi.Schema( type=openapi.TYPE_OBJECT, properties={ 'id': openapi.Schema(type=openapi.TYPE_INTEGER), 'thumbnail': openapi.Schema(type=openapi.TYPE_STRING), 'priority': openapi.Schema(type=openapi.TYPE_INTEGER) } ) ) } ) ) } ) ), 404: openapi.Response(description="Hadis not found") } ) hadis_transmitters_swagger = swagger_auto_schema( operation_description="Get all transmitters for a specific hadis including their biographical information and transmission details", operation_summary="Get Hadis Transmitters", operation_id="getHadisTransmitters", tags=['Hadis'], manual_parameters=[ openapi.Parameter( 'hadis_id', openapi.IN_PATH, description="ID of the hadis", type=openapi.TYPE_INTEGER, required=True ) ], responses={ status.HTTP_200_OK: openapi.Response( description="Hadis transmitters information", examples={ "application/json": { "hadis_id": 1, "hadis_description": "This hadith emphasizes the importance of intention in all actions...", "transmitters_count": 2, "transmitters": [ { "id": 1, "order": 1, "is_gap": False, "narrator_layer": "sahaba", "transmitter": { "id": 1, "full_name": "Abu Hurairah", "birth_year_hijri": 18, "death_year_hijri": 59, "madhhab": "sunni", "description": "One of the most prolific narrators of hadith", "reliability": "very_reliable" } }, { "id": 2, "order": 2, "is_gap": False, "narrator_layer": "tabiin", "transmitter": { "id": 2, "full_name": "Sa'id ibn al-Musayyib", "birth_year_hijri": 15, "death_year_hijri": 94, "madhhab": "sunni", "description": "Great scholar of Medina", "reliability": "reliable" } } ] } } ), status.HTTP_404_NOT_FOUND: openapi.Response( description="Hadis not found" ), status.HTTP_500_INTERNAL_SERVER_ERROR: openapi.Response( description="Internal server error" ) } ) hadis_corrections_swagger = swagger_auto_schema( operation_description=""" Retrieve all corrections, improvements, and scholarly notes for a specific hadis. **Key Features:** - Returns all corrections associated with a hadis - Includes translation corrections in multiple languages - Provides scholarly improvements and clarifications - Useful for understanding updates and refinements to hadis content **Usage:** - Use this endpoint to get corrections and improvements for a hadis - Corrections may include updated translations, authenticity clarifications, or scholarly notes - The `translation` field contains multilingual corrections (typically JSON format) - Each correction has a title and description explaining the nature of the correction **Response Structure:** - `hadis_id`: The ID of the hadis these corrections belong to - `corrections_count`: Total number of corrections available - `corrections`: Array of correction objects with details **Note:** - If no corrections exist, the corrections array will be empty - Corrections are ordered by creation date (newest first) - Translation corrections may be in JSON format with language codes as keys """, operation_summary="Get Hadis Corrections", operation_id="getHadisCorrections", tags=['Hadis'], manual_parameters=[ openapi.Parameter( 'hadis_id', openapi.IN_PATH, description="Unique identifier of the hadis. Must be a valid hadis ID that exists in the system. Only active hadis (status=True) are accessible.", type=openapi.TYPE_INTEGER, required=True, example=1 ) ], responses={ status.HTTP_200_OK: openapi.Response( description="Successfully retrieved corrections for the specified hadis", examples={ "application/json": { "hadis_id": 1, "corrections_count": 2, "corrections": [ { "id": 1, "title": "Translation Correction", "description": "Updated translation for better accuracy and clarity. The previous translation was slightly ambiguous in the context of intention and action.", "translation": { "en": "Actions are judged by intentions, and every person will have what they intended", "ar": "إنما الأعمال بالنيات وإنما لكل امرئ ما نوى", "fa": "اعمال به نیت ها قضاوت می شود و هر کس آنچه را که قصد کرده است خواهد داشت", "ur": "اعمال نیتوں کے مطابق ہیں اور ہر شخص کو وہی ملے گا جس کا اس نے ارادہ کیا" } }, { "id": 2, "title": "Authenticity Clarification", "description": "Additional scholarly notes on the authenticity and grading of this hadith. This hadith is considered authentic (sahih) by consensus of scholars.", "translation": { "en": "This hadith is authentic (sahih) according to the consensus of scholars including Imam Bukhari and Imam Muslim", "ar": "هذا الحديث صحيح حسب إجماع العلماء بما في ذلك الإمام البخاري والإمام مسلم", "fa": "این حدیث طبق اجماع علماء از جمله امام بخاری و امام مسلم صحیح است", "ur": "یہ حدیث علماء کے اجماع کے مطابق صحیح ہے جن میں امام بخاری اور امام مسلم شامل ہیں" } } ] } } ), status.HTTP_404_NOT_FOUND: openapi.Response( description="The specified hadis ID does not exist or the hadis is not active", examples={ "application/json": { "detail": "Not found." } } ), status.HTTP_500_INTERNAL_SERVER_ERROR: openapi.Response( description="Internal server error occurred while processing the request" ) } ) # Swagger documentation for HadisCollectionListView hadis_collections_swagger = swagger_auto_schema( operation_description="Get list of all active hadis collections for browsing and categorization", operation_summary="List Hadis Collections", operation_id="getHadisCollections", tags=['Hadis'], responses={ status.HTTP_200_OK: openapi.Response( description="List of hadis collections", examples={ "application/json": [ { "id": 1, "title": "Collection Title", "description": "Collection description", "order": 1, "status": True } ] } ), status.HTTP_500_INTERNAL_SERVER_ERROR: openapi.Response( description="Internal server error" ) } ) # Swagger documentation for HadisInfoView hadis_info_swagger = swagger_auto_schema( operation_description="Get statistical information about hadis database including counts of categories, references, bookmarks, and narrators", operation_summary="Get Hadis Statistics", operation_id="getHadisInfo", tags=['Hadis'], responses={ status.HTTP_200_OK: openapi.Response( description="Hadis database statistics", examples={ "application/json": { "category_count": 25, "reference_count": 150, "bookmark_count": 75, "narrator_count": 200 } } ), status.HTTP_500_INTERNAL_SERVER_ERROR: openapi.Response( description="Internal server error" ) } ) # Swagger documentation for HadisSyncView hadis_sync_swagger = swagger_auto_schema( operation_description="Get complete hadis data for offline synchronization including all categories, hadis, and related information", operation_summary="Sync Hadis Data", operation_id="syncHadisData", tags=['Hadis'], responses={ status.HTTP_200_OK: openapi.Response( description="Complete hadis data for synchronization with enhanced information", examples={ "application/json": { "count": 1500, "results": { "1": { "id": 1, "number": 1, "category_id": 2, "title": "The Opening", "title_narrator": "From Abu Hurairah", "text": "Actions are but by intention...", "description": "This hadith emphasizes the importance of intention in all actions...", "translations": { "en": "Actions are but by intention...", "ar": "إنما الأعمال بالنيات...", "fa": "اعمال به نیت است..." }, "explanation": "This hadith emphasizes the importance of intention in all actions...", "address": "Sahih al-Bukhari, Book of Revelation", "hadis_status": { "id": 1, "title": "Sahih", "color": "green" }, "hadis_status_text": "Authentic", "share_link": "http://example.com/hadis/1", "tags": [ {"id": 1, "title": "Intention"}, {"id": 2, "title": "Actions"} ], "links": { "audio": "http://example.com/audio/hadis1.mp3", "video": "http://example.com/video/hadis1.mp4" }, "transmitters": [ { "id": 1, "order": 1, "is_gap": False, "narrator_layer": "sahaba", "transmitter": { "id": 1, "full_name": "Abu Hurairah", "birth_year_hijri": 18, "death_year_hijri": 59, "madhhab": "sunni", "description": "One of the most prolific narrators of hadith", "reliability": "very_reliable" } } ], "references": [ { "id": 1, "title": "Sahih al-Bukhari", "images": [ { "id": 1, "image": "http://example.com/media/books/bukhari_cover.jpg", "order": 1, "description": "Front cover of Sahih al-Bukhari" } ], "authors": [ { "id": 1, "name": "Muhammad ibn Isma'il al-Bukhari" } ], "description": "The most authentic collection of hadith compiled by Imam Bukhari" } ], "corrections": [ { "id": 1, "title": "Translation Correction", "description": "Corrected translation for better accuracy", "translation": { "en": "Actions are judged by intentions...", "ar": "إنما الأعمال بالنيات...", "fa": "اعمال به نیت ها قضاوت می شود..." } } ] } } } } ), status.HTTP_500_INTERNAL_SERVER_ERROR: openapi.Response( description="Internal server error" ) } ) # Swagger documentation for TransmitterView transmitter_list_swagger = swagger_auto_schema( operation_description="Get list of transmitters (narrators) with optional filtering by status, madhhab, and generation", operation_summary="List Transmitters", tags=['Hadis'], manual_parameters=[ openapi.Parameter( 'status', openapi.IN_QUERY, description='Filter by reliability status (very_reliable, reliable, acceptable, weak, very_weak, unknown)', type=openapi.TYPE_STRING, required=False ), openapi.Parameter( 'madhhab', openapi.IN_QUERY, description='Filter by madhhab/school (shia, sunni, hanafi, maliki, shafii, hanbali, other, unknown)', type=openapi.TYPE_STRING, required=False ), openapi.Parameter( 'generation', openapi.IN_QUERY, description='Filter by generation (1-10 representing narrator layers/classes)', type=openapi.TYPE_INTEGER, required=False ), ], responses={ status.HTTP_200_OK: openapi.Response( description="List of transmitters with optional filtering applied", examples={ "application/json": [ { "id": 1, "full_name": "Abu Daud Sulaiman ibn al-Ash'ath al-Azdi al-Sijistani", "birth_year_hijri": 202, "death_year_hijri": 275, "description": "Imam Abu Daud, compiler of Sunan Abu Daud, one of the six major hadith collections" }, { "id": 2, "full_name": "Muhammad ibn Isma'il al-Bukhari", "birth_year_hijri": 194, "death_year_hijri": 256, "description": "Imam Bukhari, compiler of Sahih al-Bukhari, the most authentic hadith collection" } ] } ), status.HTTP_500_INTERNAL_SERVER_ERROR: openapi.Response( description="Internal server error" ) } ) # Swagger documentation for TransmitterDetailView transmitter_detail_swagger = swagger_auto_schema( operation_description="Get detailed information about a specific transmitter including their scholarly opinions and hadith transmissions", operation_summary="Get Transmitter Details", tags=['Hadis'], manual_parameters=[ openapi.Parameter( 'transmitters_id', openapi.IN_PATH, description="ID of the transmitter", type=openapi.TYPE_INTEGER, required=True ) ], responses={ status.HTTP_200_OK: openapi.Response( description="Detailed transmitter information with nested opinions and transmissions", examples={ "application/json": { "id": 1, "full_name": "Abu Daud Sulaiman ibn al-Ash'ath al-Azdi al-Sijistani", "kunya": "Abu Daud", "known_as": "Imam Abu Daud", "nickname": "Al-Sijistani", "origin": "Sijistan (modern Sistan)", "lived_in": "Basra, Baghdad", "died_in": "Basra", "birth_year_hijri": 202, "death_year_hijri": 275, "age_at_death": 73, "reliability": "very_reliable", "madhhab": "sunni", "in_sahih_bukhari": False, "in_sahih_muslim": True, "description": "Imam Abu Daud, compiler of Sunan Abu Daud", "thumbnail": "http://example.com/media/transmitters/abu_daud.jpg", } } ), status.HTTP_404_NOT_FOUND: openapi.Response( description="Transmitter not found" ), status.HTTP_500_INTERNAL_SERVER_ERROR: openapi.Response( description="Internal server error" ) } ) transmitter_sync_swagger = swagger_auto_schema( operation_description="Get complete transmitter (narrator) data for offline synchronization including biographical information and scholarly opinions", operation_summary="Sync Transmitter Data", operation_id="syncTransmitterData", tags=['Hadis'], responses={ status.HTTP_200_OK: openapi.Response( description="Complete transmitter data for synchronization", examples={ "application/json": { "count": 150, "results": { "1": { "id": 1, "full_name": "Abu Daud Sulaiman ibn al-Ash'ath al-Azdi al-Sijistani", "biographical": { "personal_info": { "full_name": "Abu Daud Sulaiman ibn al-Ash'ath al-Azdi al-Sijistani", "kunya": "Abu Daud", "known_as": "Imam Abu Daud", "nickname": "Al-Sijistani" }, "dates": { "birth_year_hijri": 202, "death_year_hijri": 275, "age_at_death": 73 }, "locations": { "origin": "Sijistan (modern Sistan)", "lived_in": "Basra, Baghdad", "died_in": "Basra" }, "religious_profile": { "reliability": "very_reliable", "madhhab": "shafii", "in_sahih_muslim": True, "in_sahih_bukhari": False }, "description": "One of the six canonical hadith collectors...", "thumbnail": "http://example.com/media/transmitters/abu_daud.jpg" }, "scholars_opinions": [ { "id": 1, "scholar_name": "Imam al-Nawawi", "opinion_text": "Abu Daud is reliable and trustworthy...", "status": "confirmed", "created_at": "2025-12-13T10:00:00Z", "updated_at": "2025-12-13T10:00:00Z" } ] } } } } ), status.HTTP_500_INTERNAL_SERVER_ERROR: openapi.Response( description="Internal server error" ) } ) # Swagger documentation for TransmitterOpinionView transmitter_opinion_swagger = swagger_auto_schema( operation_description=""" Retrieve all scholarly opinions about a specific transmitter (narrator). **Key Features:** - Returns all opinions from various scholars about the transmitter's reliability and character - Includes opinion status (confirmed, mixed, rejected) - Provides detailed opinion text from each scholar - Useful for understanding the scholarly consensus on a narrator's reliability **Usage:** - Use this endpoint to get scholarly assessments of a transmitter - Opinions help determine the reliability and authenticity of narrations - The `status` field indicates whether the opinion is confirmed, mixed, or rejected - Each opinion includes the scholar's name and their detailed assessment **Response Structure:** - Returns an array of opinion objects - Each opinion includes scholar name, opinion text, status, and timestamps - Opinions are ordered by creation date (newest first) **Opinion Status Values:** - `confirmed`: The opinion is confirmed and widely accepted - `mixed`: There are mixed views about this opinion - `rejected`: The opinion has been rejected or is not widely accepted """, operation_summary="Get Transmitter Opinions", operation_id="getTransmitterOpinions", tags=['Hadis'], manual_parameters=[ openapi.Parameter( 'transmitters_id', openapi.IN_PATH, description="Unique identifier of the transmitter (narrator). Must be a valid transmitter ID that exists in the system.", type=openapi.TYPE_INTEGER, required=True, example=56 ) ], responses={ status.HTTP_200_OK: openapi.Response( description="Successfully retrieved all scholarly opinions for the specified transmitter", examples={ "application/json": [ { "id": 1, "transmitter": 56, "scholar_name": "Ibn Hajar al-Asqalani", "opinion_text": "He was a reliable and trustworthy narrator. His narrations are accepted and he is considered among the reliable transmitters of hadith. He had good memory and was known for his accuracy in transmission.", "status": "confirmed", "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-15T10:30:00Z" }, { "id": 2, "transmitter": 56, "scholar_name": "Imam al-Dhahabi", "opinion_text": "A reliable narrator with good character. His narrations are generally accepted, though some scholars have noted minor issues in certain chains of transmission.", "status": "mixed", "created_at": "2024-01-14T14:20:00Z", "updated_at": "2024-01-14T14:20:00Z" }, { "id": 3, "transmitter": 56, "scholar_name": "Ibn Ma'in", "opinion_text": "Trustworthy and reliable. His narrations are sound and he is considered among the reliable transmitters.", "status": "confirmed", "created_at": "2024-01-13T09:15:00Z", "updated_at": "2024-01-13T09:15:00Z" } ] } ), status.HTTP_404_NOT_FOUND: openapi.Response( description="The specified transmitter ID does not exist", examples={ "application/json": { "detail": "Not found." } } ), status.HTTP_500_INTERNAL_SERVER_ERROR: openapi.Response( description="Internal server error occurred while processing the request" ) } ) # Swagger documentation for TransmitterOriginalTextView transmitter_original_text_swagger = swagger_auto_schema( operation_description=""" Retrieve all original texts associated with a specific transmitter (narrator). **Key Features:** - Returns all original texts (writings, sayings, or works) attributed to the transmitter - Includes original Arabic text and translations in multiple languages - Provides shareable links for each text - Useful for accessing the original works and writings of narrators **Usage:** - Use this endpoint to get original texts written or attributed to a transmitter - Original texts may include their writings, sayings, or scholarly works - The `translation` field contains multilingual translations (typically JSON format) - Each text has a shareable link for easy sharing **Response Structure:** - Returns an array of original text objects - Each text includes title, original text, translations, and share link - Texts are ordered by creation date (newest first) **Translation Format:** - The translation field is typically a JSON array or object - May contain translations in multiple languages - Format may vary based on how translations are stored """, operation_summary="Get Transmitter Original Texts", operation_id="getTransmitterOriginalTexts", tags=['Hadis'], manual_parameters=[ openapi.Parameter( 'transmitters_id', openapi.IN_PATH, description="Unique identifier of the transmitter (narrator). Must be a valid transmitter ID that exists in the system.", type=openapi.TYPE_INTEGER, required=True, example=56 ) ], responses={ status.HTTP_200_OK: openapi.Response( description="Successfully retrieved all original texts for the specified transmitter", examples={ "application/json": [ { "id": 1, "title": "On the Importance of Intention", "text": "إنما الأعمال بالنيات وإنما لكل امرئ ما نوى. فمن كانت هجرته إلى الله ورسوله فهجرته إلى الله ورسوله، ومن كانت هجرته لدنيا يصيبها أو امرأة ينكحها فهجرته إلى ما هاجر إليه", "translation": [ { "language_code": "en", "title": "Actions are but by intention, and every person will have what they intended. So whoever emigrated for Allah and His Messenger, then his emigration is for Allah and His Messenger. And whoever emigrated for worldly gain or to marry a woman, then his emigration is for that which he emigrated." }, { "language_code": "fa", "title": "اعمال به نیت ها است و هر کس آنچه را که قصد کرده است خواهد داشت. پس هر کس برای خدا و پیامبرش هجرت کند، هجرت او برای خدا و پیامبرش است. و هر کس برای منافع دنیوی یا ازدواج با زنی هجرت کند، هجرت او برای همان چیزی است که برای آن هجرت کرده است." } ], "share_link": "http://example.com/narrators/56/texts/1" }, { "id": 2, "title": "On Knowledge and Learning", "text": "طلب العلم فريضة على كل مسلم ومسلمة", "translation": [ { "language_code": "en", "title": "Seeking knowledge is obligatory upon every Muslim, male and female" }, { "language_code": "fa", "title": "طلب علم بر هر مسلمان و مسلمانی واجب است" } ], "share_link": "http://example.com/narrators/56/texts/2" } ] } ), status.HTTP_404_NOT_FOUND: openapi.Response( description="The specified transmitter ID does not exist", examples={ "application/json": { "detail": "Not found." } } ), status.HTTP_500_INTERNAL_SERVER_ERROR: openapi.Response( description="Internal server error occurred while processing the request" ) } ) # Swagger documentation for BookReferencesView book_references_list_swagger = swagger_auto_schema( operation_description=""" Retrieve a comprehensive list of all book references used in hadith studies. **Key Features:** - Returns all book references in the system - Includes metadata such as title, description, rating, and author information - Provides book cover images and volume counts - Useful for browsing available reference books **Usage:** - Use this endpoint to get an overview of all available reference books - The `rate` field indicates the book's rating (typically 0-5) - The `volume_count` shows how many volumes the book has - The `image` array contains book cover images and related images - The `author` field contains the primary author's name **Response Structure:** - Returns an array of book reference objects - Each book includes basic information, images, and volume count - Books are typically ordered by ID or title **Note:** - Some books may have multiple volumes (indicated by `volume_count`) - Images array may be empty if no images are available - The author field contains the name of the primary author """, operation_summary="List Book References", tags=['Hadis'], responses={ status.HTTP_200_OK: openapi.Response( description="Successfully retrieved list of all book references", examples={ "application/json": [ { "id": 1, "title": "Sahih al-Bukhari", "description": "The most authentic collection of hadith compiled by Imam Bukhari. This collection is considered the most authentic book after the Quran and contains over 7,000 hadiths.", "rate": 5.0, "author": "Muhammad ibn Isma'il al-Bukhari", "image": [ { "id": 1, "image": "http://example.com/media/books/bukhari_cover.jpg", "order": 1, "description": "Front cover of Sahih al-Bukhari", "created_at": "2024-01-01T00:00:00Z" }, { "id": 2, "image": "http://example.com/media/books/bukhari_back.jpg", "order": 2, "description": "Back cover of Sahih al-Bukhari", "created_at": "2024-01-01T00:00:00Z" } ], "volume_count": 9 }, { "id": 2, "title": "Sahih Muslim", "description": "The second most authentic collection of hadith compiled by Imam Muslim ibn al-Hajjaj. This collection is highly regarded and contains over 7,000 hadiths.", "rate": 4.9, "author": "Muslim ibn al-Hajjaj al-Qushayri", "image": [ { "id": 3, "image": "http://example.com/media/books/muslim_cover.jpg", "order": 1, "description": "Front cover of Sahih Muslim", "created_at": "2024-01-01T00:00:00Z" } ], "volume_count": 7 }, { "id": 3, "title": "Sunan Abu Daud", "description": "A collection of hadith compiled by Imam Abu Daud. Contains approximately 4,800 hadiths focusing on legal rulings.", "rate": 4.8, "author": "Abu Daud Sulaiman ibn al-Ash'ath", "image": [], "volume_count": 4 } ] } ), status.HTTP_500_INTERNAL_SERVER_ERROR: openapi.Response( description="Internal server error occurred while processing the request" ) } ) reference_sync_swagger = swagger_auto_schema( operation_description="Get complete book reference data for offline synchronization including basic information, detailed publication info, and related hadises", operation_summary="Sync Book References Data", operation_id="syncReferenceData", tags=['Hadis'], responses={ status.HTTP_200_OK: openapi.Response( description="Complete book references data for synchronization", examples={ "application/json": { "count": 50, "results": { "1": { "id": 1, "title": "Sahih al-Bukhari", "basic_info": { "title": "Sahih al-Bukhari", "authors": [ { "id": 1, "name": "Muhammad ibn Isma'il al-Bukhari" } ], "rating": 5.0, "description": "The most authentic collection of hadith compiled by Imam Bukhari", "volume": "9 volumes" }, "information": { "language": "Arabic", "isbn": "978-1234567890", "year_of_publication": "846", "number_of_pages": 4200, "volume_info": "9 volumes", "rating": 5.0 }, "hadis": [ { "id": 1, "title": "The Opening", "title_narrator": "From Abu Hurairah", "text": "Actions are but by intention...", "translation": "Actions are but by intention...", "share_link": "http://example.com/hadis/1" } ] } } } } ), status.HTTP_500_INTERNAL_SERVER_ERROR: openapi.Response( description="Internal server error" ) } ) # Swagger documentation for BookAuthorView book_authors_list_swagger = swagger_auto_schema( operation_description="Get list of all book authors who have contributed to hadith literature", operation_summary="List Book Authors", tags=['Hadis'], responses={ status.HTTP_200_OK: openapi.Response( description="List of all book authors", examples={ "application/json": [ { "id": 1, "name": "Muhammad ibn Isma'il al-Bukhari", "created_at": "2024-01-01T00:00:00Z", "updated_at": "2024-01-01T00:00:00Z" }, { "id": 2, "name": "Muslim ibn al-Hajjaj al-Qushayri", "created_at": "2024-01-01T00:00:00Z", "updated_at": "2024-01-01T00:00:00Z" } ] } ), status.HTTP_500_INTERNAL_SERVER_ERROR: openapi.Response( description="Internal server error" ) } ) # Swagger documentation for BookDetailView book_detail_swagger = swagger_auto_schema( operation_description=""" Retrieve detailed information about a specific book reference. **Key Features:** - Returns comprehensive details about a book reference - Includes publication information (ISBN, year, pages, language) - Provides author information and book images - Lists all hadis referenced from this book - Includes volume information and rating **Usage:** - Use this endpoint to get complete details about a specific book - The `hadis` array contains all hadis entries that reference this book - The `author` array may contain multiple authors if applicable - The `image` array includes all book-related images (covers, pages, etc.) - Publication details help identify specific editions **Response Structure:** - Complete book metadata including all fields from the book reference model - Related hadis entries with basic information - Author and image information - Volume count for multi-volume books **Note:** - The `hadis` field contains hadis entries that are referenced in this book - Each hadis includes its category information and translation - Images are ordered by the `order` field - The `volume_count` field shows how many volumes this book has """, operation_summary="Get Book Reference Details", tags=['Hadis'], manual_parameters=[ openapi.Parameter( 'bookreference_id', openapi.IN_PATH, description="Unique identifier of the book reference. Must be a valid book reference ID that exists in the system.", type=openapi.TYPE_INTEGER, required=True, example=1 ) ], responses={ status.HTTP_200_OK: openapi.Response( description="Successfully retrieved detailed information about the book reference", examples={ "application/json": { "id": 1, "title": "Sahih al-Bukhari", "description": "The most authentic collection of hadith compiled by Imam Bukhari. This collection is considered the most authentic book after the Quran and contains over 7,000 hadiths carefully selected from hundreds of thousands of narrations.", "language": "Arabic", "isbn": "978-1234567890", "volume": "9 volumes", "year_of_publication": "846", "number_page": 4200, "rate": 5.0, "created_at": "2024-01-01T00:00:00Z", "updated_at": "2024-01-01T00:00:00Z", "author": [ { "id": 1, "name": "Muhammad ibn Isma'il al-Bukhari", "created_at": "2024-01-01T00:00:00Z", "updated_at": "2024-01-01T00:00:00Z" } ], "image": [ { "id": 1, "image": "http://example.com/media/books/bukhari_cover.jpg", "order": 1, "description": "Front cover of Sahih al-Bukhari", "created_at": "2024-01-01T00:00:00Z" }, { "id": 2, "image": "http://example.com/media/books/bukhari_title_page.jpg", "order": 2, "description": "Title page of Sahih al-Bukhari", "created_at": "2024-01-01T00:00:00Z" } ], "hadis": [ { "id": 1, "number": 1, "title": "The Opening", "title_narrator": "From Abu Hurairah", "text": "إنما الأعمال بالنيات وإنما لكل امرئ ما نوى", "translation": "Actions are but by intention, and every person will have what they intended", "category": { "id": 1, "title": "Book of Faith", "slug": "book-of-faith", "source_type": "hadith", "sect_type": "sunni" }, "share_link": "http://example.com/hadis/1" }, { "id": 2, "number": 2, "title": "The Second Hadith", "title_narrator": "From Umar ibn al-Khattab", "text": "بينما نحن عند رسول الله صلى الله عليه وسلم ذات يوم", "translation": "While we were sitting with the Messenger of Allah (peace be upon him) one day", "category": { "id": 1, "title": "Book of Faith", "slug": "book-of-faith", "source_type": "hadith", "sect_type": "sunni" }, "share_link": "http://example.com/hadis/2" } ], "volume_count": 9 } } ), status.HTTP_404_NOT_FOUND: openapi.Response( description="The specified book reference ID does not exist", examples={ "application/json": { "detail": "Not found." } } ), status.HTTP_500_INTERNAL_SERVER_ERROR: openapi.Response( description="Internal server error occurred while processing the request" ) } ) # Swagger documentation for CategoriesView categories_list_swagger = swagger_auto_schema( operation_description=""" Retrieve a comprehensive list of all Hadis categories in the system. **Key Features:** - Returns all categories regardless of sect type or source type - Includes hierarchical information (children count) - Provides category metadata including sect association, source type, and description - Shows whether categories have direct hadis entries or child categories **Usage:** - Use this endpoint to get an overview of all available categories - The `children_count` field indicates how many subcategories exist - The `has_hadis` field shows if the category directly contains hadis (no children) - The `hadis_count` field shows the total number of hadis in this category **Response Fields:** - `id`: Unique category identifier - `title`: Category name - `sect_id`: Associated sect ID - `sect_type`: Type of Islamic sect (shia/sunni) - `source_type`: Type of source material (quran, hadith, history, fatwa, quote) - `description`: Detailed description of the category - `slug`: URL-friendly identifier - `children_count`: Number of direct child categories - `has_hadis`: Boolean indicating if category has direct hadis entries - `hadis_count`: Total number of hadis in this category """, operation_summary="List All Categories", tags=['Hadis'], responses={ status.HTTP_200_OK: openapi.Response( description="Successfully retrieved list of all hadith categories", examples={ "application/json": [ { "id": 1, "title": "Book of Faith", "sect_id": 1, "sect_type": "sunni", "source_type": "hadith", "description": "Hadiths related to Islamic faith and beliefs, including articles of faith, belief in Allah, angels, books, messengers, and the Last Day", "slug": "book-of-faith", "children_count": 3, "has_hadis": False, "hadis_count": 0 }, { "id": 2, "title": "Book of Prayer", "sect_id": 1, "sect_type": "sunni", "source_type": "hadith", "description": "Hadiths about salah (prayer) and related rulings, including prayer times, conditions, and etiquettes", "slug": "book-of-prayer", "children_count": 0, "has_hadis": True, "hadis_count": 45 }, { "id": 10, "title": "Tafsir of Surah Al-Fatiha", "sect_id": 2, "sect_type": "shia", "source_type": "quran", "description": "Commentary and interpretation of the opening chapter of the Quran", "slug": "tafsir-al-fatiha", "children_count": 0, "has_hadis": True, "hadis_count": 12 } ] } ), status.HTTP_500_INTERNAL_SERVER_ERROR: openapi.Response( description="Internal server error occurred while processing the request" ) } ) # Swagger documentation for CategoriesBySectView categories_by_sect_swagger = swagger_auto_schema( operation_description=""" Retrieve a list of Hadis categories filtered by Islamic sect type. **Key Features:** - Filters categories by sect type (shia or sunni) - Returns all categories belonging to the specified sect - Includes hierarchical information and hadis counts - Useful for building sect-specific category navigation **Usage:** - Use this endpoint to get categories for a specific Islamic sect - The `sect_type` parameter must be either 'shia' or 'sunni' - Results are ordered by the category's order field - Use the `children_count` to build hierarchical navigation **Response Structure:** - Returns an array of category objects - Each category includes sect information, source type, and hierarchical data - The `has_hadis` field indicates if the category can be used to fetch hadis directly """, operation_summary="List Categories by Sect", tags=['Hadis'], manual_parameters=[ openapi.Parameter( 'sect_type', openapi.IN_PATH, description="Type of Islamic sect. Must be either 'shia' (Shi'a Islam) or 'sunni' (Sunni Islam). This filters categories to only those belonging to the specified sect.", type=openapi.TYPE_STRING, enum=['shia', 'sunni'], required=True, example='sunni' ) ], responses={ status.HTTP_200_OK: openapi.Response( description="Successfully retrieved list of categories for the specified sect type", examples={ "application/json": [ { "id": 1, "title": "Book of Faith", "sect_id": 1, "sect_type": "sunni", "source_type": "hadith", "description": "Hadiths related to Islamic faith and beliefs, including articles of faith, belief in Allah, angels, books, messengers, and the Last Day", "slug": "book-of-faith", "children_count": 3, "has_hadis": False, "hadis_count": 0 }, { "id": 2, "title": "Book of Prayer", "sect_id": 1, "sect_type": "sunni", "source_type": "hadith", "description": "Hadiths about salah (prayer) and related rulings, including prayer times, conditions, and etiquettes", "slug": "book-of-prayer", "children_count": 0, "has_hadis": True, "hadis_count": 45 }, { "id": 3, "title": "Book of Zakat", "sect_id": 1, "sect_type": "sunni", "source_type": "hadith", "description": "Hadiths about zakat (obligatory charity) and its rulings", "slug": "book-of-zakat", "children_count": 2, "has_hadis": False, "hadis_count": 0 } ] } ), status.HTTP_400_BAD_REQUEST: openapi.Response( description="Invalid sect_type parameter. Must be 'shia' or 'sunni'", examples={ "application/json": { "detail": "Invalid sect type. Must be 'shia' or 'sunni'." } } ), status.HTTP_500_INTERNAL_SERVER_ERROR: openapi.Response( description="Internal server error occurred while processing the request" ) } ) # Swagger documentation for HadisCategoryTreeBySectView categories_tree_by_sect_swagger = swagger_auto_schema( operation_description=""" Retrieve child categories of a specific parent category within a given Islamic sect type. **Key Features:** - Returns direct children of a parent category identified by slug - Filters by sect type to ensure correct sect association - Provides hierarchical navigation through category tree - Includes information about whether categories have hadis or further children **Usage:** - Use this endpoint to navigate through the category hierarchy - The `slug` parameter identifies the parent category - The `sect_type` ensures categories belong to the correct sect - Use `children_count` to determine if a category has subcategories - Use `has_hadis` to determine if you can fetch hadis directly from this category **Navigation Flow:** 1. Start with root categories (use categories// endpoint) 2. Use the slug from a category to get its children 3. Continue navigating down the tree until you reach a category with `has_hadis: true` 4. Use that category's ID to fetch hadis using the category// endpoint """, operation_summary="Get Category Children by Sect and Slug", operation_id="getCategoryChildrenBySectAndSlug", tags=['Hadis'], manual_parameters=[ openapi.Parameter( 'sect_type', openapi.IN_PATH, description="Type of Islamic sect. Must be 'shia' or 'sunni'. This ensures categories belong to the correct sect.", type=openapi.TYPE_STRING, enum=['shia', 'sunni'], required=True, example='shia' ), openapi.Parameter( 'slug', openapi.IN_PATH, description="URL-friendly slug identifier of the parent category. This is used to locate the parent category whose children you want to retrieve. The slug is typically derived from the category title.", type=openapi.TYPE_STRING, required=True, example='book-of-faith' ) ], responses={ status.HTTP_200_OK: openapi.Response( description="Successfully retrieved list of child categories for the specified parent category", examples={ "application/json": [ { "id": 330, "title": "Tafsir of Surah Al-Fatiha", "source_type": "quran", "slug": "tafsir-al-fatiha", "sect_id": 20, "sect_type": "shia", "children_count": 0, "has_hadis": True, "hadis_count": 15 }, { "id": 331, "title": "Tafsir of Surah Al-Baqarah", "source_type": "quran", "slug": "tafsir-al-baqarah", "sect_id": 20, "sect_type": "shia", "children_count": 0, "has_hadis": True, "hadis_count": 28 }, { "id": 332, "title": "Tafsir of Surah Al-Imran", "source_type": "quran", "slug": "tafsir-al-imran", "sect_id": 20, "sect_type": "shia", "children_count": 0, "has_hadis": True, "hadis_count": 22 } ] } ), status.HTTP_404_NOT_FOUND: openapi.Response( description="Parent category with the specified slug not found in the given sect type", examples={ "application/json": { "detail": "No categories found for the specified slug and sect type." } } ), status.HTTP_500_INTERNAL_SERVER_ERROR: openapi.Response( description="Internal server error occurred while processing the request" ) } ) # Swagger documentation for HadisCategoryTreeBySectSourceView categories_tree_by_sect_source_swagger = swagger_auto_schema( operation_description=""" Retrieve child categories of a specific parent category, filtered by sect type and source material type. **Key Features:** - Returns direct children of a parent category identified by slug - Filters by both sect type and source type for precise navigation - Useful for filtering categories by source material (Quran, Hadith, History, Fatwa, Quote) - Provides hierarchical navigation with source-specific filtering **Usage:** - Use this endpoint when you need to filter categories by source material type - The `source_type` parameter allows filtering by: 'quran', 'hadith', 'history', 'fatwa', or 'quote' - This is useful for building source-specific category navigation - Combine with sect type to get categories for a specific sect and source combination **Source Types:** - `quran`: Categories related to Quranic commentary and interpretation - `hadith`: Categories containing prophetic traditions - `history`: Historical accounts and narratives - `fatwa`: Legal opinions and religious rulings - `quote`: Quotations and sayings **Navigation Flow:** 1. Start with root categories filtered by sect and source type 2. Use the slug from a category to get its children (with same source type) 3. Continue until you reach a category with `has_hadis: true` 4. Use that category's ID to fetch hadis """, operation_summary="Get Category Children by Sect, Slug and Source", operation_id="getCategoryChildrenBySectSlugAndSource", tags=['Hadis'], manual_parameters=[ openapi.Parameter( 'sect_type', openapi.IN_PATH, description="Type of Islamic sect. Must be 'shia' or 'sunni'. Ensures categories belong to the correct sect.", type=openapi.TYPE_STRING, enum=['shia', 'sunni'], required=True, example='shia' ), openapi.Parameter( 'slug', openapi.IN_PATH, description="URL-friendly slug identifier of the parent category. Used to locate the parent category whose children you want to retrieve.", type=openapi.TYPE_STRING, required=True, example='quran-commentary' ), openapi.Parameter( 'source_type', openapi.IN_PATH, description="Type of source material. Filters children to only those matching this source type. Options: 'quran' (Quranic commentary), 'hadith' (Prophetic traditions), 'history' (Historical accounts), 'fatwa' (Legal opinions), 'quote' (Quotations).", type=openapi.TYPE_STRING, enum=['quran', 'hadith', 'history', 'fatwa', 'quote'], required=True, example='quran' ) ], responses={ status.HTTP_200_OK: openapi.Response( description="Successfully retrieved list of child categories filtered by sect type and source type", examples={ "application/json": [ { "id": 330, "title": "Tafsir of Surah Al-Fatiha", "source_type": "quran", "slug": "tafsir-al-fatiha", "sect_id": 20, "sect_type": "shia", "children_count": 0, "has_hadis": True, "hadis_count": 15 }, { "id": 331, "title": "Tafsir of Surah Al-Baqarah", "source_type": "quran", "slug": "tafsir-al-baqarah", "sect_id": 20, "sect_type": "shia", "children_count": 0, "has_hadis": True, "hadis_count": 28 }, { "id": 332, "title": "Tafsir of Surah Al-Imran", "source_type": "quran", "slug": "tafsir-al-imran", "sect_id": 20, "sect_type": "shia", "children_count": 0, "has_hadis": True, "hadis_count": 22 } ] } ), status.HTTP_404_NOT_FOUND: openapi.Response( description="Parent category with the specified slug not found, or no children exist with the specified source type", examples={ "application/json": { "detail": "No categories found matching the specified criteria." } } ), status.HTTP_500_INTERNAL_SERVER_ERROR: openapi.Response( description="Internal server error occurred while processing the request" ) } )