Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into remake-remodel-dms
[akkoma] / lib / pleroma / web / api_spec / schemas / chat_message.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.ChatMessage do
6 alias OpenApiSpex.Schema
7
8 require OpenApiSpex
9
10 OpenApiSpex.schema(%{
11 title: "ChatMessage",
12 description: "Response schema for a ChatMessage",
13 type: :object,
14 properties: %{
15 id: %Schema{type: :string},
16 account_id: %Schema{type: :string, description: "The Mastodon API id of the actor"},
17 chat_id: %Schema{type: :string},
18 content: %Schema{type: :string},
19 created_at: %Schema{type: :string, format: :"date-time"},
20 emojis: %Schema{type: :array},
21 attachment: %Schema{type: :object, nullable: true}
22 },
23 example: %{
24 "account_id" => "someflakeid",
25 "chat_id" => "1",
26 "content" => "hey you again",
27 "created_at" => "2020-04-21T15:06:45.000Z",
28 "emojis" => [
29 %{
30 "static_url" => "https://dontbulling.me/emoji/Firefox.gif",
31 "visible_in_picker" => false,
32 "shortcode" => "firefox",
33 "url" => "https://dontbulling.me/emoji/Firefox.gif"
34 }
35 ],
36 "id" => "14",
37 "attachment" => nil
38 }
39 })
40 end