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.

api-docs: Fix documentation of `realm_emoji` in register response.

Lauryn Menard17134496390a
diff --git a/zerver/openapi/zulip.yaml b/zerver/openapi/zulip.yaml
index 3165f2e8db3..e7d74a71c44 100644
--- a/zerver/openapi/zulip.yaml
+++ b/zerver/openapi/zulip.yaml
@@ -11415,15 +11415,11 @@ paths:
description: |
Present if `realm_emoji` is present in `fetch_event_types`.
- An array of dictionaries where each dictionary describes a custom
+ A dictionary of objects where each object describes a custom
emoji that has been uploaded in this Zulip organization.
- oneOf:
- - type: object
- additionalProperties:
- $ref: "#/components/schemas/RealmEmoji"
- - type: array
- items:
- type: integer
+ type: object
+ additionalProperties:
+ $ref: "#/components/schemas/RealmEmoji"
realm_linkifiers:
type: array
description: |
diff --git a/zerver/tests/test_event_system.py b/zerver/tests/test_event_system.py
index a86ebb728da..6363ffd1d93 100644
--- a/zerver/tests/test_event_system.py
+++ b/zerver/tests/test_event_system.py
@@ -89,7 +89,8 @@ class EventsEndpointTest(ZulipTestCase):
# We choose realm_emoji somewhat randomly--we want
# a "boring" event type for the purpose of this test.
event_type = "realm_emoji"
- test_event = dict(id=6, type=event_type, realm_emoji=[])
+ empty_realm_emoji_dict: Dict[str, Any] = {}
+ test_event = dict(id=6, type=event_type, realm_emoji=empty_realm_emoji_dict)
# Test that call is made to deal with a returning soft deactivated user.
with mock.patch("zerver.lib.events.reactivate_user_if_soft_deactivated") as fa:
@@ -122,7 +123,7 @@ class EventsEndpointTest(ZulipTestCase):
self.assertEqual(result_dict["queue_id"], "15:12")
# sanity check the data relevant to our event
- self.assertEqual(result_dict["realm_emoji"], [])
+ self.assertEqual(result_dict["realm_emoji"], {})
# Now test with `fetch_event_types` not matching the event
return_event_queue = "15:13"
@@ -161,7 +162,7 @@ class EventsEndpointTest(ZulipTestCase):
# Check that the realm_emoji data is in there.
self.assertIn("realm_emoji", result_dict)
- self.assertEqual(result_dict["realm_emoji"], [])
+ self.assertEqual(result_dict["realm_emoji"], {})
self.assertEqual(result_dict["queue_id"], "15:13")
def test_events_register_spectators(self) -> None: