From 2db9c0bc21539ff2bb0fc1eb56f111e2b0d7f290 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Mon, 29 May 2023 19:51:38 -0700 Subject: [PATCH] openapi: Remove unused prune_schema_by_type function. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It’s unused since commit a881918a05503574d144fd90669e3a60d8d07684 (#24979). Signed-off-by: Anders Kaseorg --- zerver/openapi/openapi.py | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/zerver/openapi/openapi.py b/zerver/openapi/openapi.py index 70d0943d0b..09025bc80c 100644 --- a/zerver/openapi/openapi.py +++ b/zerver/openapi/openapi.py @@ -358,24 +358,6 @@ def fix_events(content: Dict[str, Any]) -> None: event.pop("user", None) -def prune_type_schema_by_type(schema: Dict[str, Any], type: str) -> bool: - return ("enum" in schema and type not in schema["enum"]) or ( - "allOf" in schema - and any(prune_type_schema_by_type(subschema, type) for subschema in schema["allOf"]) - ) - - -def prune_schema_by_type(schema: Dict[str, Any], type: str) -> bool: - return ( - "properties" in schema - and "type" in schema["properties"] - and prune_type_schema_by_type(schema["properties"]["type"], type) - ) or ( - "allOf" in schema - and any(prune_schema_by_type(subschema, type) for subschema in schema["allOf"]) - ) - - def validate_against_openapi_schema( content: Dict[str, Any], path: str,