X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fpleroma%2Fweb%2Fapi_spec%2Foperations%2Femoji_reaction_operation.ex;h=b254fc57bd6ac07a1093be7dd20e0814453dd6e3;hb=d7c805b0bb59f57f336e610a7e362f6d17c42474;hp=9d0e39fc72cd9ecac5c005852a87c882d6c6d625;hpb=6669ac5bf7749be325a10f92cc9eed49c6be2761;p=akkoma
diff --git a/lib/pleroma/web/api_spec/operations/emoji_reaction_operation.ex b/lib/pleroma/web/api_spec/operations/emoji_reaction_operation.ex
index 9d0e39fc7..b254fc57b 100644
--- a/lib/pleroma/web/api_spec/operations/emoji_reaction_operation.ex
+++ b/lib/pleroma/web/api_spec/operations/emoji_reaction_operation.ex
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors
+# Copyright © 2017-2021 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ApiSpec.EmojiReactionOperation do
@@ -17,7 +17,7 @@ defmodule Pleroma.Web.ApiSpec.EmojiReactionOperation do
def index_operation do
%Operation{
- tags: ["Emoji Reactions"],
+ tags: ["Emoji reactions"],
summary:
"Get an object of emoji to account mappings with accounts that reacted to the post",
parameters: [
@@ -42,11 +42,15 @@ defmodule Pleroma.Web.ApiSpec.EmojiReactionOperation do
def create_operation do
%Operation{
- tags: ["Emoji Reactions"],
- summary: "React to a post with a unicode emoji",
+ tags: ["Emoji reactions"],
+ summary: "React to a post with either a unicode or custom emoji",
parameters: [
Operation.parameter(:id, :path, FlakeID, "Status ID", required: true),
- Operation.parameter(:emoji, :path, :string, "A single character unicode emoji",
+ Operation.parameter(
+ :emoji,
+ :path,
+ :string,
+ "A single character unicode emoji, or a \:shortcode\: format emoji name",
required: true
)
],
@@ -61,11 +65,15 @@ defmodule Pleroma.Web.ApiSpec.EmojiReactionOperation do
def delete_operation do
%Operation{
- tags: ["Emoji Reactions"],
- summary: "Remove a reaction to a post with a unicode emoji",
+ tags: ["Emoji reactions"],
+ summary: "Remove a reaction to a post with either a unicode or custom emoji",
parameters: [
Operation.parameter(:id, :path, FlakeID, "Status ID", required: true),
- Operation.parameter(:emoji, :path, :string, "A single character unicode emoji",
+ Operation.parameter(
+ :emoji,
+ :path,
+ :string,
+ "A single character unicode emoji, or a \:shortcode\: format emoji name",
required: true
)
],
@@ -78,10 +86,10 @@ defmodule Pleroma.Web.ApiSpec.EmojiReactionOperation do
end
defp array_of_reactions_response do
- Operation.response("Array of Emoji Reactions", "application/json", %Schema{
+ Operation.response("Array of Emoji reactions", "application/json", %Schema{
type: :array,
items: emoji_reaction(),
- example: [emoji_reaction().example]
+ example: emoji_reaction().example
})
end
@@ -93,18 +101,34 @@ defmodule Pleroma.Web.ApiSpec.EmojiReactionOperation do
name: %Schema{type: :string, description: "Emoji"},
count: %Schema{type: :integer, description: "Count of reactions with this emoji"},
me: %Schema{type: :boolean, description: "Did I react with this emoji?"},
+ url: %Schema{
+ type: :string,
+ description: "URL of the emoji if it's custom - otherwise null",
+ nullable: true,
+ format: "url"
+ },
accounts: %Schema{
type: :array,
items: Account,
description: "Array of accounts reacted with this emoji"
}
},
- example: %{
- "name" => "ð±",
- "count" => 1,
- "me" => false,
- "accounts" => [Account.schema().example]
- }
+ example: [
+ %{
+ "name" => "ð±",
+ "count" => 1,
+ "me" => false,
+ "url" => nil,
+ "accounts" => [Account.schema().example]
+ },
+ %{
+ "name" => "dinosaur",
+ "count" => 1,
+ "me" => false,
+ "url" => "https://akkoma.dev/emoji/dinosaur.png",
+ "accounts" => [Account.schema().example]
+ }
+ ]
}
end
end