From b52d772a6e66b13bac875b7289de3bd63c087db3 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Fri, 7 Jun 2024 16:03:10 -0400 Subject: [PATCH] Add some useful logging for ApiSpec errors --- lib/pleroma/web/api_spec/cast_and_validate.ex | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/pleroma/web/api_spec/cast_and_validate.ex b/lib/pleroma/web/api_spec/cast_and_validate.ex index f3e8e093e..eb487fce7 100644 --- a/lib/pleroma/web/api_spec/cast_and_validate.ex +++ b/lib/pleroma/web/api_spec/cast_and_validate.ex @@ -18,6 +18,8 @@ defmodule Pleroma.Web.ApiSpec.CastAndValidate do alias OpenApiSpex.Plug.PutApiSpec alias Plug.Conn + require Logger + @impl Plug def init(opts) do opts @@ -51,6 +53,10 @@ defmodule Pleroma.Web.ApiSpec.CastAndValidate do conn {:error, reason} -> + Logger.error( + "Strict ApiSpec: request denied to #{conn.path_info} with params #{inspect(conn.params)}" + ) + opts = render_error.init(reason) conn