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.PleromaAppOperation do
6 alias OpenApiSpex.Operation
7 alias OpenApiSpex.Schema
8 alias Pleroma.Web.ApiSpec.Schemas.App
10 def open_api_operation(action) do
11 operation = String.to_existing_atom("#{action}_operation")
12 apply(__MODULE__, operation, [])
15 @spec index_operation() :: Operation.t()
16 def index_operation do
18 tags: ["Applications"],
19 summary: "List applications",
20 description: "List the OAuth applications for the current user",
21 operationId: "AppController.index",
23 200 => Operation.response("Array of App", "application/json", array_of_apps())
29 %Schema{type: :array, items: App, example: [App.schema().example]}