aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/api_spec/operations/custom_emoji_operation.ex
diff options
context:
space:
mode:
authorRoman Chvanikov <chvanikoff@pm.me>2020-04-29 17:03:17 +0300
committerRoman Chvanikov <chvanikoff@pm.me>2020-04-29 17:03:17 +0300
commit7ef37ed99db69d8553e638e88527ded475f54a5f (patch)
treee2a6bae013f29ca7d6a8dfb69be1aa13d0a6b5af /lib/pleroma/web/api_spec/operations/custom_emoji_operation.ex
parent37998e43636265d7709dbbf4926b07b7f94e04ea (diff)
parent58fded9858edbeb318dc011cb313e82a86fbafcb (diff)
downloadpleroma-7ef37ed99db69d8553e638e88527ded475f54a5f.tar.gz
merge develop
Diffstat (limited to 'lib/pleroma/web/api_spec/operations/custom_emoji_operation.ex')
-rw-r--r--lib/pleroma/web/api_spec/operations/custom_emoji_operation.ex35
1 files changed, 31 insertions, 4 deletions
diff --git a/lib/pleroma/web/api_spec/operations/custom_emoji_operation.ex b/lib/pleroma/web/api_spec/operations/custom_emoji_operation.ex
index a117fe460..2f812ac77 100644
--- a/lib/pleroma/web/api_spec/operations/custom_emoji_operation.ex
+++ b/lib/pleroma/web/api_spec/operations/custom_emoji_operation.ex
@@ -5,7 +5,7 @@
defmodule Pleroma.Web.ApiSpec.CustomEmojiOperation do
alias OpenApiSpex.Operation
alias OpenApiSpex.Schema
- alias Pleroma.Web.ApiSpec.Schemas.CustomEmoji
+ alias Pleroma.Web.ApiSpec.Schemas.Emoji
def open_api_operation(action) do
operation = String.to_existing_atom("#{action}_operation")
@@ -19,17 +19,17 @@ defmodule Pleroma.Web.ApiSpec.CustomEmojiOperation do
description: "Returns custom emojis that are available on the server.",
operationId: "CustomEmojiController.index",
responses: %{
- 200 => Operation.response("Custom Emojis", "application/json", custom_emojis_resposnse())
+ 200 => Operation.response("Custom Emojis", "application/json", resposnse())
}
}
end
- defp custom_emojis_resposnse do
+ defp resposnse do
%Schema{
title: "CustomEmojisResponse",
description: "Response schema for custom emojis",
type: :array,
- items: CustomEmoji,
+ items: custom_emoji(),
example: [
%{
"category" => "Fun",
@@ -58,4 +58,31 @@ defmodule Pleroma.Web.ApiSpec.CustomEmojiOperation do
]
}
end
+
+ defp custom_emoji do
+ %Schema{
+ title: "CustomEmoji",
+ description: "Schema for a CustomEmoji",
+ allOf: [
+ Emoji,
+ %Schema{
+ type: :object,
+ properties: %{
+ category: %Schema{type: :string},
+ tags: %Schema{type: :array}
+ }
+ }
+ ],
+ example: %{
+ "category" => "Fun",
+ "shortcode" => "aaaa",
+ "url" =>
+ "https://files.mastodon.social/custom_emojis/images/000/007/118/original/aaaa.png",
+ "static_url" =>
+ "https://files.mastodon.social/custom_emojis/images/000/007/118/static/aaaa.png",
+ "visible_in_picker" => true,
+ "tags" => ["Gif", "Fun"]
+ }
+ }
+ end
end