alias Pleroma.Web.ApiSpec.Schemas.ActorType
alias Pleroma.Web.ApiSpec.Schemas.ApiError
alias Pleroma.Web.ApiSpec.Schemas.BooleanLike
+ alias Pleroma.Web.ApiSpec.Schemas.List
alias Pleroma.Web.ApiSpec.Schemas.Status
alias Pleroma.Web.ApiSpec.Schemas.VisibilityScope
"Include statuses from muted acccounts."
),
Operation.parameter(:exclude_reblogs, :query, BooleanLike, "Exclude reblogs"),
+ Operation.parameter(:exclude_replies, :query, BooleanLike, "Exclude replies"),
Operation.parameter(
:exclude_visibilities,
:query,
}
end
- def follows_operation do
+ def follow_by_uri_operation do
%Operation{
tags: ["accounts"],
- summary: "Follows",
+ summary: "Follow by URI",
operationId: "AccountController.follows",
security: [%{"oAuth" => ["follow", "write:follows"]}],
- requestBody: request_body("Parameters", follows_request(), required: true),
+ requestBody: request_body("Parameters", follow_by_uri_request(), required: true),
responses: %{
200 => Operation.response("Account", "application/json", AccountRelationship),
400 => Operation.response("Error", "application/json", ApiError),
description: "Not implemented",
security: [%{"oAuth" => ["read:accounts"]}],
responses: %{
- 200 => Operation.response("Empry array", "application/json", %Schema{type: :array})
+ 200 => empty_array_response()
}
}
end
operationId: "AccountController.identity_proofs",
description: "Not implemented",
responses: %{
- 200 => Operation.response("Empry array", "application/json", %Schema{type: :array})
+ 200 => empty_array_response()
}
}
end
}
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
}
end
- defp follows_request do
+ defp follow_by_uri_request do
%Schema{
title: "AccountFollowsRequest",
description: "POST body for muting an account",
}
end
- defp list do
- %Schema{
- title: "List",
- description: "Response schema for a list",
- type: :object,
- properties: %{
- id: %Schema{type: :string},
- title: %Schema{type: :string}
- },
- example: %{
- "id" => "123",
- "title" => "my list"
- }
- }
- end
-
defp array_of_lists do
%Schema{
title: "ArrayOfLists",
description: "Response schema for lists",
type: :array,
- items: list(),
+ items: List,
example: [
%{"id" => "123", "title" => "my list"},
%{"id" => "1337", "title" => "anotehr list"}