[#2456] OpenAPI: added `embed_relationships` param definition.
[akkoma] / lib / pleroma / web / api_spec / operations / account_operation.ex
index 470fc0215f63a3a0fce3634a9419068e32eeed61..c2a56b7867543edc0e30fc4ed49776eab85fd265 100644 (file)
@@ -156,7 +156,8 @@ defmodule Pleroma.Web.ApiSpec.AccountOperation do
       description:
         "Accounts which follow the given account, if network is not hidden by the account owner.",
       parameters:
-        [%Reference{"$ref": "#/components/parameters/accountIdOrNickname"}] ++ pagination_params(),
+        [%Reference{"$ref": "#/components/parameters/accountIdOrNickname"}] ++
+          pagination_params() ++ [embed_relationships_param()],
       responses: %{
         200 => Operation.response("Accounts", "application/json", array_of_accounts())
       }
@@ -172,7 +173,8 @@ defmodule Pleroma.Web.ApiSpec.AccountOperation do
       description:
         "Accounts which the given account is following, if network is not hidden by the account owner.",
       parameters:
-        [%Reference{"$ref": "#/components/parameters/accountIdOrNickname"}] ++ pagination_params(),
+        [%Reference{"$ref": "#/components/parameters/accountIdOrNickname"}] ++
+          pagination_params() ++ [embed_relationships_param()],
       responses: %{200 => Operation.response("Accounts", "application/json", array_of_accounts())}
     }
   end
@@ -556,11 +558,12 @@ defmodule Pleroma.Web.ApiSpec.AccountOperation do
     }
   end
 
-  defp array_of_accounts do
+  def array_of_accounts do
     %Schema{
       title: "ArrayOfAccounts",
       type: :array,
-      items: Account
+      items: Account,
+      example: [Account.schema().example]
     }
   end