From d2faae36c63ee41bbef7ee5fb0f6997a529d3a91 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Sun, 22 Oct 2023 18:41:45 -0700 Subject: [PATCH] openapi: Remove fix_events. Signed-off-by: Anders Kaseorg --- zerver/openapi/openapi.py | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/zerver/openapi/openapi.py b/zerver/openapi/openapi.py index 84e28a2904..7df376caac 100644 --- a/zerver/openapi/openapi.py +++ b/zerver/openapi/openapi.py @@ -348,17 +348,6 @@ def find_openapi_endpoint(path: str) -> Optional[str]: return None -def fix_events(content: Dict[str, Any]) -> None: - """Remove undocumented events from events array. This is a makeshift - function so that further documentation of `/events` can happen with - only zulip.yaml changes and minimal other changes. It should be removed - as soon as `/events` documentation is complete. - """ - # 'user' is deprecated so remove its occurrences from the events array - for event in content["events"]: - event.pop("user", None) - - def validate_against_openapi_schema( content: Dict[str, Any], path: str, method: str, status_code: str ) -> bool: @@ -396,12 +385,6 @@ def validate_against_openapi_schema( # response have been defined this should be removed. return True - if endpoint == "/events" and method == "get": - # This a temporary function for checking only documented events - # as all events haven't been documented yet. - # TODO: Remove this after all events have been documented. - fix_events(content) - mock_request = MockRequest("http://localhost:9991/", method, "/api/v1" + path) mock_response = MockResponse( # TODO: Use original response content instead of re-serializing it.