aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/api_spec/operations/custom_emoji_operation.ex
blob: cf2215823f4c00bdd9a731999edf43cf2c224c3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Pleroma: A lightweight social networking server
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only

defmodule Pleroma.Web.ApiSpec.CustomEmojiOperation do
  alias OpenApiSpex.Operation
  alias Pleroma.Web.ApiSpec.Schemas.CustomEmojisResponse

  def open_api_operation(action) do
    operation = String.to_existing_atom("#{action}_operation")
    apply(__MODULE__, operation, [])
  end

  def index_operation do
    %Operation{
      tags: ["custom_emojis"],
      summary: "List custom custom emojis",
      description: "Returns custom emojis that are available on the server.",
      operationId: "CustomEmojiController.index",
      responses: %{
        200 => Operation.response("Custom Emojis", "application/json", CustomEmojisResponse)
      }
    }
  end
end