summaryrefslogtreecommitdiff
path: root/lib/pleroma/web/api_spec/schemas/app.ex
blob: c3d1af3be6479d796b902a8ed0ad467783803c14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Pleroma: A lightweight social networking server
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only

defmodule Pleroma.Web.ApiSpec.Schemas.App do
  alias OpenApiSpex.Schema

  require OpenApiSpex

  OpenApiSpex.schema(%{
    title: "App",
    description: "Response schema for an app",
    type: :object,
    properties: %{
      id: %Schema{type: :string},
      name: %Schema{type: :string},
      client_id: %Schema{type: :string},
      client_secret: %Schema{type: :string},
      redirect_uri: %Schema{type: :string},
      vapid_key: %Schema{type: :string},
      website: %Schema{type: :string, nullable: true}
    },
    example: %{
      "id" => "123",
      "name" => "My App",
      "client_id" => "TWhM-tNSuncnqN7DBJmoyeLnk6K3iJJ71KKXxgL1hPM",
      "client_secret" => "ZEaFUFmF0umgBX1qKJDjaU99Q31lDkOU8NutzTOoliw",
      "vapid_key" =>
        "BCk-QqERU0q-CfYZjcuB6lnyyOYfJ2AifKqfeGIm7Z-HiTU5T9eTG5GxVA0_OH5mMlI4UkkDTpaZwozy0TzdZ2M=",
      "website" => "https://myapp.com/"
    }
  })
end