X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Fapi_spec%2Foperations%2Femoji_reaction_operation.ex;h=b254fc57bd6ac07a1093be7dd20e0814453dd6e3;hb=3d964a997033ea65e97cbd08b6549f9cdf445fc9;hp=a7b306a30871e349f7fab93daa527e71612a6b15;hpb=008499f65a33f5d42a98cc3719f6ab5e8def40d6;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 a7b306a30..b254fc57b 100644 --- a/lib/pleroma/web/api_spec/operations/emoji_reaction_operation.ex +++ b/lib/pleroma/web/api_spec/operations/emoji_reaction_operation.ex @@ -43,10 +43,14 @@ defmodule Pleroma.Web.ApiSpec.EmojiReactionOperation do def create_operation do %Operation{ tags: ["Emoji reactions"], - summary: "React to a post with a unicode emoji", + 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 ) ], @@ -62,10 +66,14 @@ 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", + 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 ) ], @@ -81,7 +89,7 @@ defmodule Pleroma.Web.ApiSpec.EmojiReactionOperation do 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