openapi: Remove unused prune_schema_by_type function.

It’s unused since commit a881918a05
(#24979).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2023-05-29 19:51:38 -07:00 committed by Tim Abbott
parent 0eff862459
commit 2db9c0bc21
1 changed files with 0 additions and 18 deletions

View File

@ -358,24 +358,6 @@ def fix_events(content: Dict[str, Any]) -> None:
event.pop("user", 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( def validate_against_openapi_schema(
content: Dict[str, Any], content: Dict[str, Any],
path: str, path: str,