Skip to content

Commit

Permalink
fix set_param (#68)
Browse files Browse the repository at this point in the history
* fix set_param

* remove prefix

* add comments into code

Co-authored-by: Tanmay Mohapatra <[email protected]>

---------

Co-authored-by: Tanmay Mohapatra <[email protected]>
  • Loading branch information
jonalm and tanmaykm authored Mar 15, 2024
1 parent 48a9fff commit 6cdeb19
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/client.jl
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,13 @@ end

set_param(params::Dict{String,String}, name::String, value::Nothing; collection_format=",") = nothing
function set_param(params::Dict{String,String}, name::String, value; collection_format=",")
if !isa(value, Vector) || isempty(collection_format)
if isa(value, Dict)
# implements the default serialization (style=form, explode=true, location=queryparams)
# as mentioned in https://swagger.io/docs/specification/serialization/
for (k, v) in value
params[k] = string(v)
end
elseif !isa(value, Vector) || isempty(collection_format)
params[name] = string(value)
else
dlm = get(COLL_DLM, collection_format, ",")
Expand Down

0 comments on commit 6cdeb19

Please sign in to comment.