Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

openapi: Remove unused prune_schema_by_type function.

Anders Kaseorg2db9c0bc2153
diff --git a/zerver/openapi/openapi.py b/zerver/openapi/openapi.py
index 70d0943d0bc..09025bc80c0 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,