mirror of https://github.com/zulip/zulip.git
check-schemas: Add list of deprecated events in OpenAPI documentation.
In commit 268f858f3
, we removed the "realm_filters" event from the
schemas that we test in `zerver/lib/event_schemas.py`, but the event
is still documented (as deprecated) in the api/get-events doc.
Updates `tools/check_schemas` to not print a warning for an event
schema in the OpenAPI documentation if it's include in the list of
deprecated events list.
This commit is contained in:
parent
3b56e0f5ca
commit
6ad3ec0891
|
@ -74,7 +74,6 @@ EXEMPT_OPENAPI_NAMES = [
|
||||||
"message_event",
|
"message_event",
|
||||||
# tuple handling
|
# tuple handling
|
||||||
"muted_topics_event",
|
"muted_topics_event",
|
||||||
"realm_filters_event",
|
|
||||||
# bots, delivery_email, profile_data
|
# bots, delivery_email, profile_data
|
||||||
"realm_user_add_event",
|
"realm_user_add_event",
|
||||||
# OpenAPI is incomplete
|
# OpenAPI is incomplete
|
||||||
|
@ -84,6 +83,12 @@ EXEMPT_OPENAPI_NAMES = [
|
||||||
"reaction_remove_event",
|
"reaction_remove_event",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# This is a list of events still documented in the OpenAPI that
|
||||||
|
# are deprecated and no longer checked in event_schema.py.
|
||||||
|
DEPRECATED_EVENTS = [
|
||||||
|
"realm_filters_event",
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
def get_event_checker(event: Dict[str, Any]) -> Optional[Callable[[str, Dict[str, Any]], None]]:
|
def get_event_checker(event: Dict[str, Any]) -> Optional[Callable[[str, Dict[str, Any]], None]]:
|
||||||
name = event["type"]
|
name = event["type"]
|
||||||
|
@ -192,7 +197,8 @@ def validate_openapi_against_event_schema() -> None:
|
||||||
name += "_event"
|
name += "_event"
|
||||||
|
|
||||||
if not hasattr(event_schema, name):
|
if not hasattr(event_schema, name):
|
||||||
print("WARNING - NEED SCHEMA to match OpenAPI", name)
|
if name not in DEPRECATED_EVENTS:
|
||||||
|
print("WARNING - NEED SCHEMA to match OpenAPI", name)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
openapi_type = from_openapi(sub_node)
|
openapi_type = from_openapi(sub_node)
|
||||||
|
|
Loading…
Reference in New Issue