2020-04-21 17:51:06 +02:00
|
|
|
# Pleroma: A lightweight social networking server
|
|
|
|
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
|
|
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2020-05-04 11:08:00 +02:00
|
|
|
defmodule Pleroma.Web.ApiSpec.Schemas.ChatMessage do
|
2020-04-21 17:51:06 +02:00
|
|
|
alias OpenApiSpex.Schema
|
|
|
|
|
|
|
|
require OpenApiSpex
|
|
|
|
|
|
|
|
OpenApiSpex.schema(%{
|
2020-05-04 11:08:00 +02:00
|
|
|
title: "ChatMessage",
|
2020-04-21 17:51:06 +02:00
|
|
|
description: "Response schema for a ChatMessage",
|
2020-05-10 13:26:14 +02:00
|
|
|
nullable: true,
|
2020-04-21 17:51:06 +02:00
|
|
|
type: :object,
|
|
|
|
properties: %{
|
|
|
|
id: %Schema{type: :string},
|
2020-04-27 17:48:34 +02:00
|
|
|
account_id: %Schema{type: :string, description: "The Mastodon API id of the actor"},
|
2020-04-21 17:51:06 +02:00
|
|
|
chat_id: %Schema{type: :string},
|
2020-05-13 15:31:28 +02:00
|
|
|
content: %Schema{type: :string, nullable: true},
|
2020-04-29 21:49:13 +02:00
|
|
|
created_at: %Schema{type: :string, format: :"date-time"},
|
2020-05-06 16:12:36 +02:00
|
|
|
emojis: %Schema{type: :array},
|
|
|
|
attachment: %Schema{type: :object, nullable: true}
|
2020-04-21 17:51:06 +02:00
|
|
|
},
|
|
|
|
example: %{
|
2020-04-27 17:48:34 +02:00
|
|
|
"account_id" => "someflakeid",
|
2020-04-21 17:51:06 +02:00
|
|
|
"chat_id" => "1",
|
|
|
|
"content" => "hey you again",
|
|
|
|
"created_at" => "2020-04-21T15:06:45.000Z",
|
|
|
|
"emojis" => [
|
|
|
|
%{
|
|
|
|
"static_url" => "https://dontbulling.me/emoji/Firefox.gif",
|
|
|
|
"visible_in_picker" => false,
|
|
|
|
"shortcode" => "firefox",
|
|
|
|
"url" => "https://dontbulling.me/emoji/Firefox.gif"
|
|
|
|
}
|
|
|
|
],
|
2020-05-06 16:12:36 +02:00
|
|
|
"id" => "14",
|
|
|
|
"attachment" => nil
|
2020-04-21 17:51:06 +02:00
|
|
|
}
|
|
|
|
})
|
|
|
|
end
|