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,