2020-04-08 12:33:25 -06:00
|
|
|
# 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.Poll do
|
|
|
|
alias OpenApiSpex.Schema
|
2020-04-27 12:55:05 -06:00
|
|
|
alias Pleroma.Web.ApiSpec.Schemas.Emoji
|
2020-04-21 13:54:45 -06:00
|
|
|
alias Pleroma.Web.ApiSpec.Schemas.FlakeID
|
2020-04-08 12:33:25 -06:00
|
|
|
|
|
|
|
require OpenApiSpex
|
|
|
|
|
|
|
|
OpenApiSpex.schema(%{
|
|
|
|
title: "Poll",
|
|
|
|
description: "Response schema for account custom fields",
|
|
|
|
type: :object,
|
|
|
|
properties: %{
|
2020-04-21 13:54:45 -06:00
|
|
|
id: FlakeID,
|
2020-04-08 12:33:25 -06:00
|
|
|
expires_at: %Schema{type: :string, format: "date-time"},
|
|
|
|
expired: %Schema{type: :boolean},
|
|
|
|
multiple: %Schema{type: :boolean},
|
|
|
|
votes_count: %Schema{type: :integer},
|
|
|
|
voted: %Schema{type: :boolean},
|
2020-04-27 12:55:05 -06:00
|
|
|
emojis: %Schema{type: :array, items: Emoji},
|
2020-04-08 12:33:25 -06:00
|
|
|
options: %Schema{
|
|
|
|
type: :array,
|
|
|
|
items: %Schema{
|
|
|
|
type: :object,
|
|
|
|
properties: %{
|
|
|
|
title: %Schema{type: :string},
|
|
|
|
votes_count: %Schema{type: :integer}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
end
|