Undo API breaking changes
authorMark Felder <feld@FreeBSD.org>
Wed, 14 Oct 2020 14:54:07 +0000 (09:54 -0500)
committerMark Felder <feld@FreeBSD.org>
Wed, 14 Oct 2020 14:54:07 +0000 (09:54 -0500)
lib/pleroma/web/api_spec/operations/account_operation.ex
lib/pleroma/web/api_spec/operations/chat_operation.ex
lib/pleroma/web/api_spec/schemas/account.ex
test/pleroma/web/mastodon_api/update_credentials_test.exs

index 1696b19a5856f6cbce27082087fd7d017240a6e0..d90ddb78714151d513b798bc99e11e1db275dca0 100644 (file)
@@ -606,7 +606,7 @@ defmodule Pleroma.Web.ApiSpec.AccountOperation do
           description: "Sets the background image of the user.",
           format: :binary
         },
-        is_discoverable: %Schema{
+        discoverable: %Schema{
           allOf: [BooleanLike],
           nullable: true,
           description:
@@ -630,7 +630,7 @@ defmodule Pleroma.Web.ApiSpec.AccountOperation do
         pleroma_settings_store: %{"pleroma-fe" => %{"key" => "val"}},
         skip_thread_containment: false,
         allow_following_move: false,
-        is_discoverable: false,
+        discoverable: false,
         actor_type: "Person"
       }
     }
index 18693a5d7f183ebb71c106cf549efd4f2178de66..0dcfdb35467ef2e04f5493ef04546bb124bffd9b 100644 (file)
@@ -253,7 +253,7 @@ defmodule Pleroma.Web.ApiSpec.ChatOperation do
               "sensitive" => false,
               "note" => "lain",
               "pleroma" => %{
-                "is_discoverable" => false,
+                "discoverable" => false,
                 "actor_type" => "Person"
               },
               "fields" => []
index 459e7dba6f5fe9dda4432c80a897f6ac6932cab1..ca79f0747861b93bb63e5d40022878369ffad247 100644 (file)
@@ -124,7 +124,7 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Account do
             type: :object,
             properties: %{
               actor_type: ActorType,
-              is_discoverable: %Schema{
+              discoverable: %Schema{
                 type: :boolean,
                 description:
                   "whether the user allows discovery of the account in search results and other services."
@@ -205,7 +205,7 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Account do
         "note" => "foobar",
         "pleroma" => %{
           "actor_type" => "Person",
-          "is_discoverable" => false,
+          "discoverable" => false,
           "no_rich_text" => false,
           "show_role" => true
         },
index 383d351cf02704799c1c6f6292f557c1730fa36a..fe462caa38c07739e182c264093c2ab774280c51 100644 (file)
@@ -147,14 +147,14 @@ defmodule Pleroma.Web.MastodonAPI.UpdateCredentialsTest do
     end
 
     test "updates the user's discoverable status", %{conn: conn} do
-      assert %{"source" => %{"pleroma" => %{"is_discoverable" => true}}} =
+      assert %{"source" => %{"pleroma" => %{"discoverable" => true}}} =
                conn
-               |> patch("/api/v1/accounts/update_credentials", %{is_discoverable: "true"})
+               |> patch("/api/v1/accounts/update_credentials", %{discoverable: "true"})
                |> json_response_and_validate_schema(:ok)
 
-      assert %{"source" => %{"pleroma" => %{"is_discoverable" => false}}} =
+      assert %{"source" => %{"pleroma" => %{"discoverable" => false}}} =
                conn
-               |> patch("/api/v1/accounts/update_credentials", %{is_discoverable: "false"})
+               |> patch("/api/v1/accounts/update_credentials", %{discoverable: "false"})
                |> json_response_and_validate_schema(:ok)
     end