api: Document DELETE ../messages/{message_id}/reactions endpoint.

This refactors remove_reaction in python_examples.py to validate the
result with validate_against_openapi_schema.  Minor changes and some
additions have been made to the OpenAPI format data for
/messages/{message_id}/reactions endpoint.
This commit is contained in:
akashaviator
2020-03-07 15:50:57 +05:30
committed by Tim Abbott
parent 5dd1a1fc83
commit 700123a30b
5 changed files with 86 additions and 22 deletions

View File

@@ -715,15 +715,16 @@ def add_reaction(client, message_id):
@openapi_test_function("/messages/{message_id}/reactions:delete")
def remove_reaction(client, message_id):
# type: (Client, int) -> None
# {code_example|start}
# Remove an emoji reaction
request = {
'message_id': str(message_id),
'emoji_name': 'octopus',
'reaction_type': 'unicode_emoji'
}
result = client.remove_reaction(request)
assert result['result'] == 'success'
# {code_example|end}
validate_against_openapi_schema(result, '/messages/{message_id}/reactions', 'delete', '200')
def test_nonexistent_stream_error(client):
# type: (Client) -> None