Account schema: specify that pleroma.relationship is nullable
authorrinpatch <rinpatch@sdf.org>
Wed, 3 Feb 2021 15:10:43 +0000 (18:10 +0300)
committerrinpatch <rinpatch@sdf.org>
Wed, 3 Feb 2021 15:10:43 +0000 (18:10 +0300)
lib/pleroma/web/api_spec/helpers.ex
lib/pleroma/web/api_spec/schemas/account.ex
lib/pleroma/web/api_spec/schemas/account_relationship.ex

index 6babe0b28bfb237ceff2f50e1cfed0df87188738..6f67339e61a021e48efef0d86ad5bfbb8c68f6b4 100644 (file)
@@ -63,7 +63,7 @@ defmodule Pleroma.Web.ApiSpec.Helpers do
       :with_relationships,
       :query,
       BooleanLike,
-      "Embed relationships into accounts."
+      "Embed relationships into accounts. **If this parameter is not set account's `pleroma.relationship` is going to be `null`.**"
     )
   end
 
index 4f9b564d1e9e885f81919952bb1e22db25e00295..bd7143ab959420bb00e9b2ab2264cf3777f27fa1 100644 (file)
@@ -96,7 +96,7 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Account do
               hide_notification_contents: %Schema{type: :boolean}
             }
           },
-          relationship: AccountRelationship,
+          relationship: %Schema{allOf: [AccountRelationship], nullable: true},
           settings_store: %Schema{
             type: :object,
             description:
index 2cda196318abd2cee305b2f01ac8c091d6313aeb..16b73ebb4191e02d32be50bcbc8e34b7ba13a6ee 100644 (file)
@@ -10,7 +10,7 @@ defmodule Pleroma.Web.ApiSpec.Schemas.AccountRelationship do
 
   OpenApiSpex.schema(%{
     title: "AccountRelationship",
-    description: "Response schema for relationship",
+    description: "Relationship between current account and requested account",
     type: :object,
     properties: %{
       blocked_by: %Schema{type: :boolean},