Chats: Add API specs.
[akkoma] / lib / pleroma / web / api_spec / schemas / chats_response.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.ChatsResponse do
6 alias Pleroma.Web.ApiSpec.Schemas.ChatResponse
7
8 require OpenApiSpex
9
10 OpenApiSpex.schema(%{
11 title: "ChatsResponse",
12 description: "Response schema for multiple Chats",
13 type: :array,
14 items: ChatResponse,
15 example: [
16 %{
17 "recipient" => "https://dontbulling.me/users/lain",
18 "recipient_account" => %{
19 "pleroma" => %{
20 "is_admin" => false,
21 "confirmation_pending" => false,
22 "hide_followers_count" => false,
23 "is_moderator" => false,
24 "hide_favorites" => true,
25 "ap_id" => "https://dontbulling.me/users/lain",
26 "hide_follows_count" => false,
27 "hide_follows" => false,
28 "background_image" => nil,
29 "skip_thread_containment" => false,
30 "hide_followers" => false,
31 "relationship" => %{},
32 "tags" => []
33 },
34 "avatar" =>
35 "https://dontbulling.me/media/065a4dd3c6740dab13ff9c71ec7d240bb9f8be9205c9e7467fb2202117da1e32.jpg",
36 "following_count" => 0,
37 "header_static" => "https://originalpatchou.li/images/banner.png",
38 "source" => %{
39 "sensitive" => false,
40 "note" => "lain",
41 "pleroma" => %{
42 "discoverable" => false,
43 "actor_type" => "Person"
44 },
45 "fields" => []
46 },
47 "statuses_count" => 1,
48 "locked" => false,
49 "created_at" => "2020-04-16T13:40:15.000Z",
50 "display_name" => "lain",
51 "fields" => [],
52 "acct" => "lain@dontbulling.me",
53 "id" => "9u6Qw6TAZANpqokMkK",
54 "emojis" => [],
55 "avatar_static" =>
56 "https://dontbulling.me/media/065a4dd3c6740dab13ff9c71ec7d240bb9f8be9205c9e7467fb2202117da1e32.jpg",
57 "username" => "lain",
58 "followers_count" => 0,
59 "header" => "https://originalpatchou.li/images/banner.png",
60 "bot" => false,
61 "note" => "lain",
62 "url" => "https://dontbulling.me/users/lain"
63 },
64 "id" => "1",
65 "unread" => 2
66 }
67 ]
68 })
69 end