Merge remote-tracking branch 'origin/develop' into pr-7444-finish
This commit is contained in:
commit
7a741736ea
1544 changed files with 43219 additions and 9351 deletions
|
|
@ -21,6 +21,7 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Account do
|
|||
acct: %Schema{type: :string},
|
||||
avatar_static: %Schema{type: :string, format: :uri},
|
||||
avatar: %Schema{type: :string, format: :uri},
|
||||
avatar_description: %Schema{type: :string},
|
||||
bot: %Schema{type: :boolean},
|
||||
created_at: %Schema{type: :string, format: "date-time"},
|
||||
display_name: %Schema{type: :string},
|
||||
|
|
@ -31,9 +32,9 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Account do
|
|||
following_count: %Schema{type: :integer},
|
||||
header_static: %Schema{type: :string, format: :uri},
|
||||
header: %Schema{type: :string, format: :uri},
|
||||
header_description: %Schema{type: :string},
|
||||
id: FlakeID,
|
||||
locked: %Schema{type: :boolean},
|
||||
mute_expires_at: %Schema{type: :string, format: "date-time", nullable: true},
|
||||
note: %Schema{type: :string, format: :html},
|
||||
statuses_count: %Schema{type: :integer},
|
||||
url: %Schema{type: :string, format: :uri},
|
||||
|
|
@ -111,7 +112,9 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Account do
|
|||
format: :uri,
|
||||
nullable: true,
|
||||
description: "Favicon image of the user's instance"
|
||||
}
|
||||
},
|
||||
avatar_description: %Schema{type: :string, deprecated: true},
|
||||
header_description: %Schema{type: :string, deprecated: true}
|
||||
}
|
||||
},
|
||||
source: %Schema{
|
||||
|
|
@ -152,6 +155,7 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Account do
|
|||
example: %{
|
||||
"acct" => "foobar",
|
||||
"avatar" => "https://mypleroma.com/images/avi.png",
|
||||
"avatar_description" => "",
|
||||
"avatar_static" => "https://mypleroma.com/images/avi.png",
|
||||
"bot" => false,
|
||||
"created_at" => "2020-03-24T13:05:58.000Z",
|
||||
|
|
@ -162,6 +166,7 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Account do
|
|||
"followers_count" => 0,
|
||||
"following_count" => 1,
|
||||
"header" => "https://mypleroma.com/images/banner.png",
|
||||
"header_description" => "",
|
||||
"header_static" => "https://mypleroma.com/images/banner.png",
|
||||
"id" => "9tKi3esbG7OQgZ2920",
|
||||
"locked" => false,
|
||||
|
|
|
|||
|
|
@ -26,7 +26,9 @@ defmodule Pleroma.Web.ApiSpec.Schemas.AccountRelationship do
|
|||
requested: %Schema{type: :boolean},
|
||||
showing_reblogs: %Schema{type: :boolean},
|
||||
subscribing: %Schema{type: :boolean},
|
||||
notifying: %Schema{type: :boolean}
|
||||
notifying: %Schema{type: :boolean},
|
||||
mute_expires_at: %Schema{type: :string, format: "date-time", nullable: true},
|
||||
block_expires_at: %Schema{type: :string, format: "date-time", nullable: true}
|
||||
},
|
||||
example: %{
|
||||
"blocked_by" => false,
|
||||
|
|
|
|||
19
lib/pleroma/web/api_spec/schemas/api_not_found_error.ex
Normal file
19
lib/pleroma/web/api_spec/schemas/api_not_found_error.ex
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Pleroma.Web.ApiSpec.Schemas.ApiNotFoundError do
|
||||
alias OpenApiSpex.Schema
|
||||
|
||||
require OpenApiSpex
|
||||
|
||||
OpenApiSpex.schema(%{
|
||||
title: "Not Found",
|
||||
description: "Response schema for 404 API errors",
|
||||
type: :object,
|
||||
properties: %{error: %Schema{type: :string}},
|
||||
example: %{
|
||||
"error" => "Record not found"
|
||||
}
|
||||
})
|
||||
end
|
||||
|
|
@ -15,12 +15,18 @@ defmodule Pleroma.Web.ApiSpec.Schemas.BookmarkFolder do
|
|||
properties: %{
|
||||
id: FlakeID,
|
||||
name: %Schema{type: :string, description: "Folder name"},
|
||||
emoji: %Schema{type: :string, description: "Folder emoji", nullable: true}
|
||||
emoji: %Schema{type: :string, description: "Folder emoji", nullable: true},
|
||||
emoji_url: %Schema{
|
||||
type: :string,
|
||||
description: "URL of the folder emoji if it's a custom emoji, null otherwise",
|
||||
nullable: true
|
||||
}
|
||||
},
|
||||
example: %{
|
||||
"id" => "9toJCu5YZW7O7gfvH6",
|
||||
"name" => "Read later",
|
||||
"emoji" => nil
|
||||
"emoji" => nil,
|
||||
"emoji_url" => nil
|
||||
}
|
||||
})
|
||||
end
|
||||
|
|
|
|||
|
|
@ -17,7 +17,8 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Chat do
|
|||
account: %Schema{type: :object},
|
||||
unread: %Schema{type: :integer},
|
||||
last_message: ChatMessage,
|
||||
updated_at: %Schema{type: :string, format: :"date-time"}
|
||||
updated_at: %Schema{type: :string, format: :"date-time"},
|
||||
pinned: %Schema{type: :boolean}
|
||||
},
|
||||
example: %{
|
||||
"account" => %{
|
||||
|
|
@ -68,8 +69,9 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Chat do
|
|||
},
|
||||
"id" => "1",
|
||||
"unread" => 2,
|
||||
"last_message" => ChatMessage.schema().example(),
|
||||
"updated_at" => "2020-04-21T15:06:45.000Z"
|
||||
"last_message" => ChatMessage.schema().example,
|
||||
"updated_at" => "2020-04-21T15:06:45.000Z",
|
||||
"pinned" => false
|
||||
}
|
||||
})
|
||||
end
|
||||
|
|
|
|||
|
|
@ -13,11 +13,30 @@ defmodule Pleroma.Web.ApiSpec.Schemas.List do
|
|||
type: :object,
|
||||
properties: %{
|
||||
id: %Schema{type: :string, description: "The internal database ID of the list"},
|
||||
title: %Schema{type: :string, description: "The user-defined title of the list"}
|
||||
title: %Schema{type: :string, description: "The user-defined title of the list"},
|
||||
exclusive: %Schema{
|
||||
type: :boolean,
|
||||
description: "Whether members of the list should be removed from the “Home” feed"
|
||||
},
|
||||
pleroma: %Schema{
|
||||
type: :object,
|
||||
properties: %{
|
||||
emoji: %Schema{type: :string, description: "List emoji", nullable: true},
|
||||
emoji_url: %Schema{
|
||||
type: :string,
|
||||
description: "URL of the list emoji if it's a custom emoji, null otherwise",
|
||||
nullable: true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
example: %{
|
||||
"id" => "12249",
|
||||
"title" => "Friends"
|
||||
"title" => "Friends",
|
||||
"pleroma" => %{
|
||||
"emoji" => nil,
|
||||
"emoji_url" => nil
|
||||
}
|
||||
}
|
||||
})
|
||||
end
|
||||
|
|
|
|||
|
|
@ -258,7 +258,9 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Status do
|
|||
},
|
||||
quotes_count: %Schema{
|
||||
type: :integer,
|
||||
description: "How many statuses quoted this status"
|
||||
deprecated: true,
|
||||
description:
|
||||
"How many statuses quoted this status. Deprecated, use `quotes_count` from parent object instead."
|
||||
},
|
||||
local: %Schema{
|
||||
type: :boolean,
|
||||
|
|
@ -288,10 +290,20 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Status do
|
|||
nullable: true,
|
||||
description:
|
||||
"A datetime (ISO 8601) that states when the post was pinned or `null` if the post is not pinned"
|
||||
},
|
||||
list_id: %Schema{
|
||||
type: :integer,
|
||||
nullable: true,
|
||||
description:
|
||||
"The ID of the list the post is addressed to (if any, only returned to author)"
|
||||
}
|
||||
}
|
||||
},
|
||||
poll: %Schema{allOf: [Poll], nullable: true, description: "The poll attached to the status"},
|
||||
quotes_count: %Schema{
|
||||
type: :integer,
|
||||
description: "How many statuses quoted this status."
|
||||
},
|
||||
reblog: %Schema{
|
||||
allOf: [%OpenApiSpex.Reference{"$ref": "#/components/schemas/Status"}],
|
||||
nullable: true,
|
||||
|
|
@ -418,6 +430,7 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Status do
|
|||
"quotes_count" => 0
|
||||
},
|
||||
"poll" => nil,
|
||||
"quotes_count" => 0,
|
||||
"reblog" => nil,
|
||||
"reblogged" => false,
|
||||
"reblogs_count" => 0,
|
||||
|
|
|
|||
|
|
@ -17,11 +17,22 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Tag do
|
|||
type: :string,
|
||||
format: :uri,
|
||||
description: "A link to the hashtag on the instance"
|
||||
},
|
||||
following: %Schema{
|
||||
type: :boolean,
|
||||
description: "Whether the authenticated user is following the hashtag"
|
||||
},
|
||||
history: %Schema{
|
||||
type: :array,
|
||||
items: %Schema{type: :string},
|
||||
description:
|
||||
"A list of historical uses of the hashtag (not implemented, for compatibility only)"
|
||||
}
|
||||
},
|
||||
example: %{
|
||||
name: "cofe",
|
||||
url: "https://lain.com/tag/cofe"
|
||||
url: "https://lain.com/tag/cofe",
|
||||
following: false
|
||||
}
|
||||
})
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue