aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/api_spec
diff options
context:
space:
mode:
authormarcin mikołajczak <git@mkljczk.pl>2022-01-10 21:35:55 +0100
committermarcin mikołajczak <git@mkljczk.pl>2022-01-12 18:15:10 +0100
commit0f90fd58052aa372aaad63d769cd724046c9f61f (patch)
tree9ead892e5f740df707e9f6172845de74e4792c35 /lib/pleroma/web/api_spec
parent4f249b23977d7426c6249875b538c7a6c1b239ff (diff)
downloadpleroma-0f90fd58052aa372aaad63d769cd724046c9f61f.tar.gz
WIP account endorsements
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
Diffstat (limited to 'lib/pleroma/web/api_spec')
-rw-r--r--lib/pleroma/web/api_spec/operations/account_operation.ex14
-rw-r--r--lib/pleroma/web/api_spec/operations/pleroma_account_operation.ex15
2 files changed, 13 insertions, 16 deletions
diff --git a/lib/pleroma/web/api_spec/operations/account_operation.ex b/lib/pleroma/web/api_spec/operations/account_operation.ex
index 35d8609ef..768d3c720 100644
--- a/lib/pleroma/web/api_spec/operations/account_operation.ex
+++ b/lib/pleroma/web/api_spec/operations/account_operation.ex
@@ -343,7 +343,15 @@ defmodule Pleroma.Web.ApiSpec.AccountOperation do
description: "Addds the given account to endorsed accounts list.",
parameters: [%Reference{"$ref": "#/components/parameters/accountIdOrNickname"}],
responses: %{
- 200 => Operation.response("Relationship", "application/json", AccountRelationship)
+ 200 => Operation.response("Relationship", "application/json", AccountRelationship),
+ 400 =>
+ Operation.response("Bad Request", "application/json", %Schema{
+ allOf: [ApiError],
+ title: "Unprocessable Entity",
+ example: %{
+ "error" => "You have already pinned the maximum number of users"
+ }
+ })
}
}
end
@@ -453,10 +461,10 @@ defmodule Pleroma.Web.ApiSpec.AccountOperation do
tags: ["Retrieve account information"],
summary: "Endorsements",
operationId: "AccountController.endorsements",
- description: "Not implemented",
+ description: "Returns endorsed accounts",
security: [%{"oAuth" => ["read:accounts"]}],
responses: %{
- 200 => empty_array_response()
+ 200 => Operation.response("Array of Accounts", "application/json", array_of_accounts())
}
}
end
diff --git a/lib/pleroma/web/api_spec/operations/pleroma_account_operation.ex b/lib/pleroma/web/api_spec/operations/pleroma_account_operation.ex
index 9996ff68b..ed0db173e 100644
--- a/lib/pleroma/web/api_spec/operations/pleroma_account_operation.ex
+++ b/lib/pleroma/web/api_spec/operations/pleroma_account_operation.ex
@@ -4,10 +4,10 @@
defmodule Pleroma.Web.ApiSpec.PleromaAccountOperation do
alias OpenApiSpex.Operation
+ alias Pleroma.Web.ApiSpec.AccountOperation
alias Pleroma.Web.ApiSpec.Schemas.AccountRelationship
alias Pleroma.Web.ApiSpec.Schemas.ApiError
alias Pleroma.Web.ApiSpec.Schemas.FlakeID
- alias Pleroma.Web.ApiSpec.AccountOperation
alias Pleroma.Web.ApiSpec.StatusOperation
import Pleroma.Web.ApiSpec.Helpers
@@ -69,17 +69,7 @@ defmodule Pleroma.Web.ApiSpec.PleromaAccountOperation do
summary: "Endorsements",
description: "Returns endorsed accounts",
operationId: "PleromaAPI.AccountController.endorsements",
- parameters:
- [
- Operation.parameter(
- :shuffle,
- :query,
- :boolean,
- "Show endorsed accounts in random order"
- ),
- id_param()
- ] ++ pagination_params(),
- security: [%{"oAuth" => ["read:account"]}],
+ parameters: [with_relationships_param(), id_param()],
responses: %{
200 =>
Operation.response(
@@ -87,7 +77,6 @@ defmodule Pleroma.Web.ApiSpec.PleromaAccountOperation do
"application/json",
AccountOperation.array_of_accounts()
),
- 403 => Operation.response("Forbidden", "application/json", ApiError),
404 => Operation.response("Not Found", "application/json", ApiError)
}
}