alias OpenApiSpex.Schema
alias Pleroma.Web.ApiSpec.Schemas.AccountEmoji
alias Pleroma.Web.ApiSpec.Schemas.AccountField
+ alias Pleroma.Web.ApiSpec.Schemas.AccountRelationship
alias Pleroma.Web.ApiSpec.Schemas.ActorType
+ alias Pleroma.Web.ApiSpec.Schemas.FlakeID
alias Pleroma.Web.ApiSpec.Schemas.VisibilityScope
require OpenApiSpex
following_count: %Schema{type: :integer},
header_static: %Schema{type: :string, format: :uri},
header: %Schema{type: :string, format: :uri},
- id: %Schema{type: :string},
+ id: FlakeID,
locked: %Schema{type: :boolean},
note: %Schema{type: :string, format: :html},
statuses_count: %Schema{type: :integer},
privacy_option: %Schema{type: :boolean}
}
},
- relationship: %Schema{
- type: :object,
- properties: %{
- blocked_by: %Schema{type: :boolean},
- blocking: %Schema{type: :boolean},
- domain_blocking: %Schema{type: :boolean},
- endorsed: %Schema{type: :boolean},
- followed_by: %Schema{type: :boolean},
- following: %Schema{type: :boolean},
- id: %Schema{type: :string},
- muting: %Schema{type: :boolean},
- muting_notifications: %Schema{type: :boolean},
- requested: %Schema{type: :boolean},
- showing_reblogs: %Schema{type: :boolean},
- subscribing: %Schema{type: :boolean}
- }
- },
+ relationship: AccountRelationship,
settings_store: %Schema{
type: :object
}
defmodule Pleroma.Web.ApiSpec.Schemas.AccountRelationship do
alias OpenApiSpex.Schema
+ alias Pleroma.Web.ApiSpec.Schemas.FlakeID
require OpenApiSpex
endorsed: %Schema{type: :boolean},
followed_by: %Schema{type: :boolean},
following: %Schema{type: :boolean},
- id: %Schema{type: :string},
+ id: FlakeID,
muting: %Schema{type: :boolean},
muting_notifications: %Schema{type: :boolean},
requested: %Schema{type: :boolean},
--- /dev/null
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Pleroma.Web.ApiSpec.Schemas.FlakeID do
+ require OpenApiSpex
+
+ OpenApiSpex.schema(%{
+ title: "FlakeID",
+ description:
+ "Pleroma uses 128-bit ids as opposed to Mastodon's 64 bits. However just like Mastodon's ids they are sortable strings",
+ type: :string
+ })
+end
defmodule Pleroma.Web.ApiSpec.Schemas.Poll do
alias OpenApiSpex.Schema
alias Pleroma.Web.ApiSpec.Schemas.AccountEmoji
+ alias Pleroma.Web.ApiSpec.Schemas.FlakeID
require OpenApiSpex
description: "Response schema for account custom fields",
type: :object,
properties: %{
- id: %Schema{type: :string},
+ id: FlakeID,
expires_at: %Schema{type: :string, format: "date-time"},
expired: %Schema{type: :boolean},
multiple: %Schema{type: :boolean},
alias OpenApiSpex.Schema
alias Pleroma.Web.ApiSpec.Schemas.Account
alias Pleroma.Web.ApiSpec.Schemas.AccountEmoji
+ alias Pleroma.Web.ApiSpec.Schemas.FlakeID
alias Pleroma.Web.ApiSpec.Schemas.Poll
alias Pleroma.Web.ApiSpec.Schemas.VisibilityScope
emojis: %Schema{type: :array, items: AccountEmoji},
favourited: %Schema{type: :boolean},
favourites_count: %Schema{type: :integer},
- id: %Schema{type: :string},
+ id: FlakeID,
in_reply_to_account_id: %Schema{type: :string, nullable: true},
in_reply_to_id: %Schema{type: :string, nullable: true},
language: %Schema{type: :string, nullable: true},