Skip to content

Commit

Permalink
Merge pull request #101 from jfacorro/maintain.argument.order
Browse files Browse the repository at this point in the history
Maintain original order in lists
  • Loading branch information
amilkr authored May 29, 2017
2 parents 629c27d + 81a44ca commit 7861a17
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/cowboy_swagger.erl
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ normalize_list_values(List) ->
(V, Acc) ->
[V | Acc]
end,
lists:foldl(F, [], List).
lists:foldr(F, [], List).

%% @private
validate_swagger_map(Map) ->
Expand Down
8 changes: 4 additions & 4 deletions test/cowboy_swagger_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ to_json_test(_Config) ->
<<"parameters">> := [
#{<<"description">> := <<"bla">>,
<<"in">> := <<"path">>,
<<"name">> := <<"c">>,
<<"name">> := <<"b">>,
<<"required">> := false,
<<"type">> := <<"string">>},
#{<<"description">> := <<"bla">>,
<<"in">> := <<"path">>,
<<"name">> := <<"b">>,
<<"name">> := <<"c">>,
<<"required">> := false,
<<"type">> := <<"string">>}
],
Expand Down Expand Up @@ -87,12 +87,12 @@ to_json_test(_Config) ->
<<"parameters">> := [
#{<<"description">> := <<"bla">>,
<<"in">> := <<"path">>,
<<"name">> := <<"c">>,
<<"name">> := <<"b">>,
<<"required">> := false,
<<"type">> := <<"string">>},
#{<<"description">> := <<"bla">>,
<<"in">> := <<"path">>,
<<"name">> := <<"b">>,
<<"name">> := <<"c">>,
<<"required">> := false,
<<"type">> := <<"string">>}
]
Expand Down

0 comments on commit 7861a17

Please sign in to comment.