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: Use enum for reaction_type.

Chris Bobbead7dcc7d83d6
diff --git a/zerver/lib/event_schema.py b/zerver/lib/event_schema.py
index bb5bb1756e5..32920c03e8a 100644
--- a/zerver/lib/event_schema.py
+++ b/zerver/lib/event_schema.py
@@ -468,7 +468,7 @@ reaction_add_event = event_dict_type(
("message_id", int),
("emoji_name", str),
("emoji_code", str),
- ("reaction_type", str),
+ ("reaction_type", EnumType(["unicode_emoji", "realm_emoji", "zulip_extra_emoji"])),
("user_id", int),
("user", reaction_legacy_user_type),
]
@@ -483,7 +483,7 @@ reaction_remove_event = event_dict_type(
("message_id", int),
("emoji_name", str),
("emoji_code", str),
- ("reaction_type", str),
+ ("reaction_type", EnumType(["unicode_emoji", "realm_emoji", "zulip_extra_emoji"])),
("user_id", int),
("user", reaction_legacy_user_type),
]
@@ -1767,7 +1767,7 @@ user_status_event = event_dict_type(
("status_text", str),
("emoji_name", str),
("emoji_code", str),
- ("reaction_type", str),
+ ("reaction_type", EnumType(["unicode_emoji", "realm_emoji", "zulip_extra_emoji"])),
],
)
_check_user_status = make_checker(user_status_event)
diff --git a/zerver/openapi/zulip.yaml b/zerver/openapi/zulip.yaml
index 62619c30581..318b1c5c95b 100644
--- a/zerver/openapi/zulip.yaml
+++ b/zerver/openapi/zulip.yaml
@@ -1695,6 +1695,10 @@ paths:
**Changes**: New in Zulip 5.0 (feature level 86).
reaction_type:
type: string
+ enum:
+ - unicode_emoji
+ - realm_emoji
+ - zulip_extra_emoji
description: |
The [emoji type](/api/update-status#parameter-reaction_type) for
the emoji the user selected for their new status.
@@ -12102,6 +12106,10 @@ paths:
**Changes**: New in Zulip 5.0 (feature level 86).
reaction_type:
type: string
+ enum:
+ - unicode_emoji
+ - realm_emoji
+ - zulip_extra_emoji
description: |
If present, a string indicating the type of emoji. Each emoji
`reaction_type` has an independent namespace for values of `emoji_code`.
@@ -18305,6 +18313,10 @@ components:
within the namespace of the `reaction_type`.
reaction_type:
type: string
+ enum:
+ - unicode_emoji
+ - realm_emoji
+ - zulip_extra_emoji
description: |
A string indicating the type of emoji. Each emoji `reaction_type`
has an independent namespace for values of `emoji_code`.