Skip to content

Commit

Permalink
Optimize config map transform
Browse files Browse the repository at this point in the history
  • Loading branch information
ycherniavskyi committed Sep 6, 2023
1 parent 598cbdd commit 6271d6e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/open_api_spex/plug/swagger_ui.ex
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ defmodule OpenApiSpex.Plug.SwaggerUI do
defp supplement_config(config, conn) do
endpoint_module = Phoenix.Controller.endpoint_module(conn)

Enum.map(config, fn
Map.new(config, fn
{k, {:endpoint_url, path}} ->
{k, Path.join(endpoint_module.url(), endpoint_module.path(path))}

Expand All @@ -206,7 +206,6 @@ defmodule OpenApiSpex.Plug.SwaggerUI do
k_v ->
k_v
end)
|> Map.new()
end
else
defp supplement_config(config, _conn) do
Expand Down

0 comments on commit 6271d6e

Please sign in to comment.