docs: Add OpenAPI data for /messages/{message_id}/reactions.

This change adds the OpenAPI data needed to document the POST and
DELETE methods associated with this endpoint.

Descriptions edited slightly by tabbott.
This commit is contained in:
Laurel Michaels
2019-09-24 18:46:14 +00:00
committed by Tim Abbott
parent 8d38f0593b
commit a67769091d
2 changed files with 126 additions and 1 deletions

View File

@@ -843,6 +843,132 @@ paths:
"rendered": "<p><strong>foo</strong></p>",
"result": "success"
}
/messages/{message_id}/reactions:
post:
description: Add an emoji reaction to a message.
parameters:
- name: message_id
in: path
description: The ID of the message that you want to add an emoji reaction to.
schema:
type: integer
example: 42
required: true
- name: emoji_name
in: query
description: |
Name of the emoji you want to add as as a reaction.
To find an emoji's name, hover over a message to
reveal three icons on the right, then click the smiley face icon.
Images of available reaction emojis appear. Hover over the emoji
you want, and note that emoji's text name.
schema:
type: string
example: '**:slight smile:**'
required: true
- name: emoji_code
in: query
description: |
An encoded version of the unicode codepoint. Used only
in rare corner cases to consolidate identical reactions
to the same emoji name.
schema:
type: string
example: '**foo**'
required: false
- name: reaction_type
in: query
description: |
If you are reacting with a [custom emoji](/help/add-custom-emoji),
set `reaction_type` to `realm_emoji`.
schema:
type: string
example: '**realm_emoji**'
required: false
security:
- basicAuth: []
responses:
'200':
description: Success.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/JsonSuccess'
- properties:
rendered:
type: string
description: The rendered HTML.
- example:
{
"msg": "",
"rendered": "<p><strong>foo</strong></p>",
"result": "success"
}
delete:
description: Delete an emoji reaction from a message.
parameters:
- name: message_id
in: path
description: The ID of the message from which you want to delete the emoji reaction.
schema:
type: integer
example: 42
required: true
- name: emoji_name
in: query
description: |
Name of the emoji you want to delete from a reaction.
To find an emoji's name, hover over a message to
reveal three icons on the right, then click the smiley face icon.
Images of available reaction emojis appear. Hover over the emoji
you want, and note that emoji's text name.
schema:
type: string
example: '**:slight smile:**'
required: true
- name: emoji_code
in: query
description: |
An encoded version of the unicode codepoint for the emoji.
Should be passed when adding a vote to an existing emoji reaction,
or order to handle unlikely corner cases where the emoji name to
codepoint mapping has changed since the first reaction was added.
schema:
type: string
example: '**foo**'
required: false
- name: reaction_type
in: query
description: |
If you are reacting with a [custom emoji](/help/add-custom-emoji),
set `reaction_type` to `realm_emoji`.
schema:
type: string
example: '**realm_emoji**'
required: false
security:
- basicAuth: []
responses:
'200':
description: Success.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/JsonSuccess'
- properties:
rendered:
type: string
description: The rendered HTML.
- example:
{
"msg": "",
"rendered": "<p><strong>foo</strong></p>",
"result": "success"
}
/user_uploads:
post:
description: Upload a single file and get the corresponding URI.

View File

@@ -218,7 +218,6 @@ class OpenAPIArgumentsTest(ZulipTestCase):
'/invites/{prereg_id}/resend',
'/invites/multiuse/{invite_id}',
'/users/me/subscriptions/{stream_id}',
'/messages/{message_id}/reactions',
'/messages/{message_id}/emoji_reactions/{emoji_name}',
'/attachments/{attachment_id}',
'/user_groups/{user_group_id}/members',