Skip to content

Commit

Permalink
Merge pull request #118 from thoroai/fix/metadata-newline-output
Browse files Browse the repository at this point in the history
fix: ensure generated code matches expected output
  • Loading branch information
onno-vos-dev authored Nov 20, 2024
2 parents 871d01b + ed04a82 commit 879a665
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions priv/rest.ex.eex
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,11 @@ defmodule <%= context.module_name %> do
)
<% end %>

meta =
<%= if action.host_prefix do %>
metadata() |> Map.put_new(:host_prefix, <%= inspect(action.host_prefix) %>)
<% else %>
metadata()
<% end %>
<%= if action.host_prefix do %>
meta = metadata() |> Map.put_new(:host_prefix, <%= inspect(action.host_prefix) %>)
<% else %>
meta = metadata()
<% end %>

Request.request_rest(client, meta, :get, url_path, query_params, headers, nil, options, <%= inspect(action.success_status_code) %>)<% else %>
@spec <%= action.function_name %>(map()<%= AWS.CodeGen.Types.function_parameter_types(action.method, action, false)%>, <%= if context.module_name == "AWS.ApiGatewayManagementApi" do %> String.t(), <% end %><%= AWS.CodeGen.Types.function_argument_type(context.language, action)%>, list()) :: <%= AWS.CodeGen.Types.return_type(context.language, action)%>
Expand Down Expand Up @@ -161,12 +160,11 @@ def <%= action.function_name %>(%Client{} = client<%= AWS.CodeGen.RestService.fu
)
<% end %>

meta =
<%= if action.host_prefix do %>
metadata() |> Map.put_new(:host_prefix, <%= inspect(action.host_prefix) %>)
<% else %>
metadata()
<% end %>
<%= if action.host_prefix do %>
meta = metadata() |> Map.put_new(:host_prefix, <%= inspect(action.host_prefix) %>)
<% else %>
meta = metadata()
<% end %>

Request.request_rest(client, meta, <%= AWS.CodeGen.RestService.Action.method(action) %>, url_path, query_params, headers, input, options, <%= inspect(action.success_status_code) %>)<% end %>
end<% end %>
Expand Down

0 comments on commit 879a665

Please sign in to comment.