From f4aab1da4641f6135144e4f0c07e796c5aef466a Mon Sep 17 00:00:00 2001 From: Alberto Sartori Date: Wed, 23 Mar 2022 09:23:28 +0100 Subject: [PATCH] Update lib/open_api_spex/cast_parameters.ex --- lib/open_api_spex/cast_parameters.ex | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/open_api_spex/cast_parameters.ex b/lib/open_api_spex/cast_parameters.ex index a6e8c14a..190aa7fe 100644 --- a/lib/open_api_spex/cast_parameters.ex +++ b/lib/open_api_spex/cast_parameters.ex @@ -14,7 +14,10 @@ defmodule OpenApiSpex.CastParameters do end end - defp cast_conn(conn, params), do: Plug.Conn.put_private(:open_api_spex, Map.put(conn.private.open_api_spex, :params, params)) + defp cast_conn(conn, params) do + private_oas = Map.put(conn.private.open_api_spex, :params, params) + Plug.Conn.put_private(conn, :open_api_spex, private_oas) + end defp maybe_replace_params(conn, _params, false), do: conn defp maybe_replace_params(conn, params, true), do: %{conn | params: params}