aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-05-10 13:08:01 +0200
committerlain <lain@soykaf.club>2020-05-10 13:08:01 +0200
commit172d9b11936bb029093eac430c58c89a81592c08 (patch)
tree1b179215318abd6f95b41a6854cbef30779961a6
parent17be3ff669865102848df034045eb2889eed3976 (diff)
downloadpleroma-172d9b11936bb029093eac430c58c89a81592c08.tar.gz
Chat: Add last_message to schema.
-rw-r--r--lib/pleroma/web/api_spec/schemas/chat.ex11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/pleroma/web/api_spec/schemas/chat.ex b/lib/pleroma/web/api_spec/schemas/chat.ex
index 4d385d6ab..8aaa4a792 100644
--- a/lib/pleroma/web/api_spec/schemas/chat.ex
+++ b/lib/pleroma/web/api_spec/schemas/chat.ex
@@ -4,6 +4,7 @@
defmodule Pleroma.Web.ApiSpec.Schemas.Chat do
alias OpenApiSpex.Schema
+ alias Pleroma.Web.ApiSpec.Schemas.ChatMessage
require OpenApiSpex
@@ -12,9 +13,10 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Chat do
description: "Response schema for a Chat",
type: :object,
properties: %{
- id: %Schema{type: :string, nullable: false},
- account: %Schema{type: :object, nullable: false},
- unread: %Schema{type: :integer, nullable: false}
+ id: %Schema{type: :string},
+ account: %Schema{type: :object},
+ unread: %Schema{type: :integer},
+ last_message: %Schema{type: ChatMessage, nullable: true}
},
example: %{
"account" => %{
@@ -64,7 +66,8 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Chat do
"url" => "https://dontbulling.me/users/lain"
},
"id" => "1",
- "unread" => 2
+ "unread" => 2,
+ "last_message" => ChatMessage.schema().example()
}
})
end