Add spec for AccountController.statuses
[akkoma] / lib / pleroma / web / api_spec / schemas / poll.ex
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Web.ApiSpec.Schemas.Poll do
6 alias OpenApiSpex.Schema
7 alias Pleroma.Web.ApiSpec.Schemas.AccountEmoji
8
9 require OpenApiSpex
10
11 OpenApiSpex.schema(%{
12 title: "Poll",
13 description: "Response schema for account custom fields",
14 type: :object,
15 properties: %{
16 id: %Schema{type: :string},
17 expires_at: %Schema{type: :string, format: "date-time"},
18 expired: %Schema{type: :boolean},
19 multiple: %Schema{type: :boolean},
20 votes_count: %Schema{type: :integer},
21 voted: %Schema{type: :boolean},
22 emojis: %Schema{type: :array, items: AccountEmoji},
23 options: %Schema{
24 type: :array,
25 items: %Schema{
26 type: :object,
27 properties: %{
28 title: %Schema{type: :string},
29 votes_count: %Schema{type: :integer}
30 }
31 }
32 }
33 }
34 })
35 end