Add OpenAPI spec for MarkerController
[akkoma] / lib / pleroma / web / api_spec / schemas / markers_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.MarkersResponse do
6 require OpenApiSpex
7 alias OpenApiSpex.Schema
8
9 alias Pleroma.Web.ApiSpec.Schemas.Marker
10
11 OpenApiSpex.schema(%{
12 title: "MarkersResponse",
13 description: "Response schema for markers",
14 type: :object,
15 properties: %{
16 notifications: %Schema{allOf: [Marker], nullable: true},
17 home: %Schema{allOf: [Marker], nullable: true}
18 },
19 items: %Schema{type: :string},
20 example: %{
21 "notifications" => %{
22 "last_read_id" => "35098814",
23 "version" => 361,
24 "updated_at" => "2019-11-26T22:37:25.239Z",
25 "pleroma" => %{"unread_count" => 0}
26 },
27 "home" => %{
28 "last_read_id" => "103206604258487607",
29 "version" => 468,
30 "updated_at" => "2019-11-26T22:37:25.235Z",
31 "pleroma" => %{"unread_count" => 10}
32 }
33 }
34 })
35 end