1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.ApiSpec.CustomEmojiOperation do
6 alias OpenApiSpex.Operation
7 alias OpenApiSpex.Schema
8 alias Pleroma.Web.ApiSpec.Schemas.Emoji
10 def open_api_operation(action) do
11 operation = String.to_existing_atom("#{action}_operation")
12 apply(__MODULE__, operation, [])
15 def index_operation do
17 tags: ["Custom emojis"],
18 summary: "Retrieve a list of custom emojis",
19 description: "Returns custom emojis that are available on the server.",
20 operationId: "CustomEmojiController.index",
22 200 => Operation.response("Custom Emojis", "application/json", resposnse())
29 title: "CustomEmojisResponse",
30 description: "Response schema for custom emojis",
32 items: custom_emoji(),
36 "shortcode" => "blank",
37 "static_url" => "https://lain.com/emoji/blank.png",
39 "url" => "https://lain.com/emoji/blank.png",
40 "visible_in_picker" => false
43 "category" => "Gif,Fun",
44 "shortcode" => "firefox",
45 "static_url" => "https://lain.com/emoji/Firefox.gif",
46 "tags" => ["Gif", "Fun"],
47 "url" => "https://lain.com/emoji/Firefox.gif",
48 "visible_in_picker" => true
51 "category" => "pack:mixed",
52 "shortcode" => "sadcat",
53 "static_url" => "https://lain.com/emoji/mixed/sadcat.png",
54 "tags" => ["pack:mixed"],
55 "url" => "https://lain.com/emoji/mixed/sadcat.png",
56 "visible_in_picker" => true
65 description: "Schema for a CustomEmoji",
71 category: %Schema{type: :string},
72 tags: %Schema{type: :array, items: %Schema{type: :string}}
78 "shortcode" => "aaaa",
80 "https://files.mastodon.social/custom_emojis/images/000/007/118/original/aaaa.png",
82 "https://files.mastodon.social/custom_emojis/images/000/007/118/static/aaaa.png",
83 "visible_in_picker" => true,
84 "tags" => ["Gif", "Fun"]