From 979f02ec947443835f480d13bd1dbcf521743a71 Mon Sep 17 00:00:00 2001 From: Egor Kislitsyn Date: Mon, 29 Jun 2020 17:33:00 +0400 Subject: [PATCH 1/2] Fix CastAndValidate plug --- lib/pleroma/web/api_spec/cast_and_validate.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pleroma/web/api_spec/cast_and_validate.ex b/lib/pleroma/web/api_spec/cast_and_validate.ex index bd9026237..fbfc27d6f 100644 --- a/lib/pleroma/web/api_spec/cast_and_validate.ex +++ b/lib/pleroma/web/api_spec/cast_and_validate.ex @@ -40,7 +40,7 @@ def call(%{private: %{open_api_spex: private_data}} = conn, %{ |> List.first() _ -> - nil + "application/json" end private_data = Map.put(private_data, :operation_id, operation_id) From 3aa04b81c4d558dfa8d3c35ab7db6041671ac121 Mon Sep 17 00:00:00 2001 From: Egor Kislitsyn Date: Mon, 29 Jun 2020 19:47:04 +0400 Subject: [PATCH 2/2] Test default "content-type" for CastAndValidate --- test/web/mastodon_api/controllers/account_controller_test.exs | 1 - 1 file changed, 1 deletion(-) diff --git a/test/web/mastodon_api/controllers/account_controller_test.exs b/test/web/mastodon_api/controllers/account_controller_test.exs index ebfcedd01..260ad2306 100644 --- a/test/web/mastodon_api/controllers/account_controller_test.exs +++ b/test/web/mastodon_api/controllers/account_controller_test.exs @@ -780,7 +780,6 @@ test "with notifications", %{conn: conn} do assert %{"id" => _id, "muting" => true, "muting_notifications" => true} = conn - |> put_req_header("content-type", "application/json") |> post("/api/v1/accounts/#{other_user.id}/mute") |> json_response_and_validate_schema(200)