Add HadisCategoryXMindView API endpoint and Swagger documentation
- Implemented HadisCategoryXMindView to retrieve a mind-map JSON structure for specific hadis categories.
- Added Swagger documentation detailing the endpoint's features, usage, and response structure.
- Updated URL routing to include the new endpoint for XMind format retrieval.
- Enhanced the HadisCategoryXMindView to support multi-language content and bookmark status for authenticated users.
description="Unique slug identifier of the Hadis category. Must be a valid category slug that exists in the system.",
type=openapi.TYPE_STRING,
required=True,
example='cat-l3-25-7f5bcb'
),
openapi.Parameter(
'lang',
openapi.IN_QUERY,
description="Language code for content localization. Supported codes: 'en' (English), 'fa' (Persian), 'ar' (Arabic), 'ur' (Urdu), 'ru' (Russian). Defaults to 'en' if not specified. Can also be set via Accept-Language header.",
type=openapi.TYPE_STRING,
required=False,
default='en',
enum=['en','fa','ar','ur','ru']
),
openapi.Parameter(
'Accept-Language',
openapi.IN_HEADER,
description="Alternative way to specify language code. If both query parameter and header are provided, query parameter takes precedence.",
type=openapi.TYPE_STRING,
required=False,
default='en',
enum=['en','fa','ar','ur','ru']
)
],
responses={
status.HTTP_200_OK:openapi.Response(
description="Successfully retrieved mind-map structure for the specified category",
examples={
"application/json":{
"rootTopic":{
"id":"cat-25",
"title":"Book of Faith",
"structureClass":"org.xmind.ui.map.unbalanced",
"children":{
"attached":[
{
"id":1,
"slug":"hadis-intention-and-actions",
"title":"The Intention",
"title_narrator":"From Umar ibn al-Khattab",
"text":"إنما الأعمال بالنيات وإنما لكل امرئ ما نوى",
"translation":"Actions are but by intention, and every man shall have only what he intended",