Merge branch 'develop' into global-status-expiration
[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.Emoji
8 alias Pleroma.Web.ApiSpec.Schemas.FlakeID
9
10 require OpenApiSpex
11
12 OpenApiSpex.schema(%{
13 title: "Poll",
14 description: "Response schema for account custom fields",
15 type: :object,
16 properties: %{
17 id: FlakeID,
18 expires_at: %Schema{type: :string, format: "date-time"},
19 expired: %Schema{type: :boolean},
20 multiple: %Schema{type: :boolean},
21 votes_count: %Schema{type: :integer},
22 voted: %Schema{type: :boolean},
23 emojis: %Schema{type: :array, items: Emoji},
24 options: %Schema{
25 type: :array,
26 items: %Schema{
27 type: :object,
28 properties: %{
29 title: %Schema{type: :string},
30 votes_count: %Schema{type: :integer}
31 }
32 }
33 }
34 }
35 })
36 end