diff --git a/src/cowboy_swagger.erl b/src/cowboy_swagger.erl index 2dd6521..8ce747c 100644 --- a/src/cowboy_swagger.erl +++ b/src/cowboy_swagger.erl @@ -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) -> diff --git a/test/cowboy_swagger_SUITE.erl b/test/cowboy_swagger_SUITE.erl index cfc8990..69ee937 100644 --- a/test/cowboy_swagger_SUITE.erl +++ b/test/cowboy_swagger_SUITE.erl @@ -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">>} ], @@ -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">>} ]