mirror of https://github.com/zulip/zulip.git
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:
parent
0eff862459
commit
2db9c0bc21
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue