diff options
author | lain <lain@soykaf.club> | 2020-04-21 10:13:50 +0000 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-04-21 10:13:50 +0000 |
commit | 3c828016d9d1ecb1ebcebb00aaadec2ace37f807 (patch) | |
tree | 6a16c384fed5344c517cca726fd6b38ef0eb64b4 /lib/pleroma/web/api_spec/operations/custom_emoji_operation.ex | |
parent | e57c1b60e4a0f882d5217bf1be8b1a7240aa322d (diff) | |
parent | c28aaf9d82a781508eba886bd455767a110d1b7c (diff) | |
download | pleroma-3c828016d9d1ecb1ebcebb00aaadec2ace37f807.tar.gz |
Merge branch 'openapi/custom-emojis' into 'develop'
Add OpenAPI spec for CustomEmojiController
See merge request pleroma/pleroma!2375
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.ex | 25 |
1 files changed, 25 insertions, 0 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 new file mode 100644 index 000000000..cf2215823 --- /dev/null +++ b/lib/pleroma/web/api_spec/operations/custom_emoji_operation.ex @@ -0,0 +1,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 |