From b4083360a272d44175ae3209e2a00ebfa0ad418c Mon Sep 17 00:00:00 2001 From: McSym28 Date: Wed, 11 Sep 2024 10:26:52 +0300 Subject: [PATCH] Add names to arguments in functions' specs --- lib/open_api/renderer/operation.ex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/open_api/renderer/operation.ex b/lib/open_api/renderer/operation.ex index 7baaf6c..acbfc02 100644 --- a/lib/open_api/renderer/operation.ex +++ b/lib/open_api/renderer/operation.ex @@ -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)