aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/api_spec
diff options
context:
space:
mode:
authorSean King <seanking2919@protonmail.com>2021-08-25 21:01:04 -0600
committerSean King <seanking2919@protonmail.com>2021-08-25 21:01:04 -0600
commit6519732045596b1f0b0e83c365db516afba913d9 (patch)
treeeb038264edbcee494260f88594ef19283e960324 /lib/pleroma/web/api_spec
parent84ec0fbeaadc8bdbce256212258a932530088346 (diff)
downloadpleroma-6519732045596b1f0b0e83c365db516afba913d9.tar.gz
GET /api/v1/apps endpoint
Diffstat (limited to 'lib/pleroma/web/api_spec')
-rw-r--r--lib/pleroma/web/api_spec/operations/app_operation.ex39
1 files changed, 39 insertions, 0 deletions
diff --git a/lib/pleroma/web/api_spec/operations/app_operation.ex b/lib/pleroma/web/api_spec/operations/app_operation.ex
index dfb1c7170..72032a4e0 100644
--- a/lib/pleroma/web/api_spec/operations/app_operation.ex
+++ b/lib/pleroma/web/api_spec/operations/app_operation.ex
@@ -13,6 +13,19 @@ defmodule Pleroma.Web.ApiSpec.AppOperation do
apply(__MODULE__, operation, [])
end
+ @spec index_operation() :: Operation.t()
+ def index_operation do
+ %Operation{
+ tags: ["Applications"],
+ summary: "List applications",
+ description: "List the OAuth applications for the current user",
+ operationId: "AppController.index",
+ responses: %{
+ 200 => Operation.response("App", "application/json", index_response()),
+ }
+ }
+ end
+
@spec create_operation() :: Operation.t()
def create_operation do
%Operation{
@@ -145,4 +158,30 @@ defmodule Pleroma.Web.ApiSpec.AppOperation do
}
}
end
+
+ defp index_response do
+ %Schema{
+ title: "AppIndexResponse",
+ description: "Response schema for GET /api/v1/apps",
+ 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
end