Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add names to arguments in functions' specs #71

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/open_api/renderer/operation.ex
Original file line number Diff line number Diff line change
Expand Up @@ -361,17 +361,17 @@ defmodule OpenAPI.Renderer.Operation do
} = operation

path_parameters =
for %Param{value_type: type} <- path_params do
quote(do: unquote(Util.to_type(state, type)))
for %Param{name: name, value_type: type} <- path_params do
quote(do: unquote({String.to_atom(name), [], nil}) :: unquote(Util.to_type(state, type)))
end

request_body =
if length(request_body) > 0 do
body_type = {:union, Enum.map(request_body, fn {_content_type, type} -> type end)}
quote(do: unquote(Util.to_type(state, body_type)))
quote(do: body :: unquote(Util.to_type(state, body_type)))
end

opts = quote(do: keyword)
opts = quote(do: opts :: keyword)

arguments = path_parameters ++ Enum.reject([request_body, opts], &is_nil/1)
return_type = render_return_type(state, responses)
Expand Down
Loading