Skip to content

Commit

Permalink
Update lib/open_api_spex/cast_parameters.ex
Browse files Browse the repository at this point in the history
  • Loading branch information
albertored authored Mar 23, 2022
1 parent 76ad0ba commit f4aab1d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/open_api_spex/cast_parameters.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit f4aab1d

Please sign in to comment.