diff options
author | rinpatch <rin@patch.cx> | 2021-02-17 15:58:33 +0300 |
---|---|---|
committer | rinpatch <rin@patch.cx> | 2021-02-17 16:03:24 +0300 |
commit | d7ad288c849965c027ea496c8665f178cc559f20 (patch) | |
tree | 2d5340c3eb5f977a0287f23a3eb4a0a4a1839609 /lib/pleroma/web/api_spec | |
parent | d5270a1c41dfd731068ab6addf06c593b3a59c11 (diff) | |
download | pleroma-d7ad288c849965c027ea496c8665f178cc559f20.tar.gz |
Chats: Introduce /api/v2/pleroma/chats which implements pagination
Also removes incorrect claim that /api/v1/pleroma/chats supports
pagination and deprecates it.
Closes #2140
Diffstat (limited to 'lib/pleroma/web/api_spec')
-rw-r--r-- | lib/pleroma/web/api_spec/operations/chat_operation.ex | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/lib/pleroma/web/api_spec/operations/chat_operation.ex b/lib/pleroma/web/api_spec/operations/chat_operation.ex index b49700172..23cb66392 100644 --- a/lib/pleroma/web/api_spec/operations/chat_operation.ex +++ b/lib/pleroma/web/api_spec/operations/chat_operation.ex @@ -131,10 +131,32 @@ defmodule Pleroma.Web.ApiSpec.ChatOperation do def index_operation do %Operation{ tags: ["Chats"], - summary: "Retrieve list of chats", + summary: "Retrieve list of chats (unpaginated)", + deprecated: true, + description: + "Deprecated due to no support for pagination. Using [/api/v2/pleroma/chats](#operation/ChatController.index2) instead is recommended.", operationId: "ChatController.index", parameters: [ Operation.parameter(:with_muted, :query, BooleanLike, "Include chats from muted users") + ], + responses: %{ + 200 => Operation.response("The chats of the user", "application/json", chats_response()) + }, + security: [ + %{ + "oAuth" => ["read:chats"] + } + ] + } + end + + def index2_operation do + %Operation{ + tags: ["Chats"], + summary: "Retrieve list of chats", + operationId: "ChatController.index2", + parameters: [ + Operation.parameter(:with_muted, :query, BooleanLike, "Include chats from muted users") | pagination_params() ], responses: %{ |