aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/api_spec/operations
diff options
context:
space:
mode:
authorEgor Kislitsyn <egor@kislitsyn.com>2020-04-06 00:15:37 +0400
committerEgor Kislitsyn <egor@kislitsyn.com>2020-04-13 17:38:59 +0400
commitf80116125f928de36c93627bbdf5f6578396f53b (patch)
treea8991a6a5d3589f87738df034a38d5b49f90c1b0 /lib/pleroma/web/api_spec/operations
parentb08ded6c2f5ee29c6efc8c67cfc2ce0a679f0c77 (diff)
downloadpleroma-f80116125f928de36c93627bbdf5f6578396f53b.tar.gz
Add spec for AccountController.verify_credentials
Diffstat (limited to 'lib/pleroma/web/api_spec/operations')
-rw-r--r--lib/pleroma/web/api_spec/operations/account_operation.ex14
-rw-r--r--lib/pleroma/web/api_spec/operations/app_operation.ex6
2 files changed, 13 insertions, 7 deletions
diff --git a/lib/pleroma/web/api_spec/operations/account_operation.ex b/lib/pleroma/web/api_spec/operations/account_operation.ex
index 9085f1af1..3d2270c29 100644
--- a/lib/pleroma/web/api_spec/operations/account_operation.ex
+++ b/lib/pleroma/web/api_spec/operations/account_operation.ex
@@ -4,9 +4,10 @@
defmodule Pleroma.Web.ApiSpec.AccountOperation do
alias OpenApiSpex.Operation
+ alias Pleroma.Web.ApiSpec.Helpers
+ alias Pleroma.Web.ApiSpec.Schemas.Account
alias Pleroma.Web.ApiSpec.Schemas.AccountCreateRequest
alias Pleroma.Web.ApiSpec.Schemas.AccountCreateResponse
- alias Pleroma.Web.ApiSpec.Helpers
@spec open_api_operation(atom) :: Operation.t()
def open_api_operation(action) do
@@ -30,7 +31,16 @@ defmodule Pleroma.Web.ApiSpec.AccountOperation do
end
def verify_credentials_operation do
- :ok
+ %Operation{
+ tags: ["accounts"],
+ description: "Test to make sure that the user token works.",
+ summary: "Verify account credentials",
+ operationId: "AccountController.verify_credentials",
+ security: [%{"oAuth" => ["read:accounts"]}],
+ responses: %{
+ 200 => Operation.response("Account", "application/json", Account)
+ }
+ }
end
def update_credentials_operation do
diff --git a/lib/pleroma/web/api_spec/operations/app_operation.ex b/lib/pleroma/web/api_spec/operations/app_operation.ex
index 26d8dbd42..935215c64 100644
--- a/lib/pleroma/web/api_spec/operations/app_operation.ex
+++ b/lib/pleroma/web/api_spec/operations/app_operation.ex
@@ -51,11 +51,7 @@ defmodule Pleroma.Web.ApiSpec.AppOperation do
summary: "Verify your app works",
description: "Confirm that the app's OAuth2 credentials work.",
operationId: "AppController.verify_credentials",
- security: [
- %{
- "oAuth" => ["read"]
- }
- ],
+ security: [%{"oAuth" => ["read"]}],
responses: %{
200 =>
Operation.response("App", "application/json", %Schema{