aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/api_spec/schemas/conversation.ex
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-05-06 11:44:30 +0200
committerlain <lain@soykaf.club>2020-05-06 11:44:30 +0200
commit205313e54146c00374e3edfa951132a7229fa16d (patch)
treedb392c5ef71a2a40fb8a041635d2536b34dc454d /lib/pleroma/web/api_spec/schemas/conversation.ex
parent9637cded21cef1e6c531dd46d5f5245c4c3ed03c (diff)
parent07e7c80bc9e919cd92ca9dda1e21384142e5bd77 (diff)
downloadpleroma-205313e54146c00374e3edfa951132a7229fa16d.tar.gz
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into remake-remodel-dms
Diffstat (limited to 'lib/pleroma/web/api_spec/schemas/conversation.ex')
-rw-r--r--lib/pleroma/web/api_spec/schemas/conversation.ex41
1 files changed, 41 insertions, 0 deletions
diff --git a/lib/pleroma/web/api_spec/schemas/conversation.ex b/lib/pleroma/web/api_spec/schemas/conversation.ex
new file mode 100644
index 000000000..d8ff5ba26
--- /dev/null
+++ b/lib/pleroma/web/api_spec/schemas/conversation.ex
@@ -0,0 +1,41 @@
+# 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.Conversation do
+ alias OpenApiSpex.Schema
+ alias Pleroma.Web.ApiSpec.Schemas.Account
+ alias Pleroma.Web.ApiSpec.Schemas.Status
+
+ require OpenApiSpex
+
+ OpenApiSpex.schema(%{
+ title: "Conversation",
+ description: "Represents a conversation with \"direct message\" visibility.",
+ type: :object,
+ required: [:id, :accounts, :unread],
+ properties: %{
+ id: %Schema{type: :string},
+ accounts: %Schema{
+ type: :array,
+ items: Account,
+ description: "Participants in the conversation"
+ },
+ unread: %Schema{
+ type: :boolean,
+ description: "Is the conversation currently marked as unread?"
+ },
+ # last_status: Status
+ last_status: %Schema{
+ allOf: [Status],
+ description: "The last status in the conversation, to be used for optional display"
+ }
+ },
+ example: %{
+ "id" => "418450",
+ "unread" => true,
+ "accounts" => [Account.schema().example],
+ "last_status" => Status.schema().example
+ }
+ })
+end