alias Pleroma.Web.ApiSpec.Schemas.AccountsResponse
alias Pleroma.Web.ApiSpec.Schemas.AccountUpdateCredentialsRequest
alias Pleroma.Web.ApiSpec.Schemas.BooleanLike
+ alias Pleroma.Web.ApiSpec.Schemas.ListsResponse
alias Pleroma.Web.ApiSpec.Schemas.StatusesResponse
alias Pleroma.Web.ApiSpec.Schemas.VisibilityScope
}
end
- def lists_operation, do: :ok
+ def lists_operation do
+ %Operation{
+ tags: ["accounts"],
+ summary: "Lists containing this account",
+ operationId: "AccountController.lists",
+ security: [%{"oAuth" => ["read:lists"]}],
+ description: "User lists that you have added this account to.",
+ parameters: [
+ %Reference{"$ref": "#/components/parameters/accountIdOrNickname"}
+ ],
+ responses: %{
+ 200 => Operation.response("Lists", "application/json", ListsResponse)
+ }
+ }
+ end
+
def follow_operation, do: :ok
def unfollow_operation, do: :ok
def mute_operation, do: :ok
--- /dev/null
+# 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.Schemas.List do
+ alias OpenApiSpex.Schema
+
+ require OpenApiSpex
+
+ OpenApiSpex.schema(%{
+ title: "List",
+ description: "Response schema for a list",
+ type: :object,
+ properties: %{
+ id: %Schema{type: :string},
+ title: %Schema{type: :string}
+ },
+ example: %{
+ "JSON" => %{
+ "id" => "123",
+ "title" => "my list"
+ }
+ }
+ })
+end
--- /dev/null
+# 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.Schemas.ListsResponse do
+ alias Pleroma.Web.ApiSpec.Schemas.List
+
+ require OpenApiSpex
+
+ OpenApiSpex.schema(%{
+ title: "ListsResponse",
+ description: "Response schema for lists",
+ type: :array,
+ items: List
+ })
+end