1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.ApiSpec.DirectoryOperation do
6 alias OpenApiSpex.Operation
7 alias Pleroma.Web.ApiSpec.AccountOperation
8 alias Pleroma.Web.ApiSpec.Schemas.ApiError
9 alias Pleroma.Web.ApiSpec.Schemas.BooleanLike
11 import Pleroma.Web.ApiSpec.Helpers
13 def open_api_operation(action) do
14 operation = String.to_existing_atom("#{action}_operation")
15 apply(__MODULE__, operation, [])
18 def index_operation do
21 summary: "Profile directory",
22 operationId: "DirectoryController.index",
29 "Order by recent activity or account creation",
32 Operation.parameter(:local, :query, BooleanLike, "Include local users only")
33 ] ++ pagination_params(),
36 Operation.response("Accounts", "application/json", AccountOperation.array_of_accounts()),
37 404 => Operation.response("Not Found", "application/json", ApiError)