Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
openapi: Add dataclass for holding article path fields.
Suyash Vardhan Mathur1375e99ae7c8
diff --git a/zerver/views/documentation.py b/zerver/views/documentation.pyindex 05c2303f95d..33df1acc3e5 100644--- a/zerver/views/documentation.py+++ b/zerver/views/documentation.py@@ -2,7 +2,8 @@ import osimport randomimport refrom collections import OrderedDict-from typing import Any, Dict, Tuple+from dataclasses import dataclass+from typing import Any, Dict, Optional, Tuplefrom django.conf import settingsfrom django.http import HttpRequest, HttpResponse, HttpResponseNotFound@@ -19,6 +20,14 @@ from zerver.models import Realmfrom zerver.openapi.openapi import get_endpoint_from_operationid, get_openapi_summary+@dataclass+class DocumentationArticle:+ article_path: str+ article_http_status: int+ endpoint_path: Optional[str]+ endpoint_method: Optional[str]++def add_api_uri_context(context: Dict[str, Any], request: HttpRequest) -> None:context.update(zulip_default_context(request))