我在测试控制器发送params时遇到了一些麻烦: 我发送以下地图:
params = %{
"filter" => %{
"type" => "all",
"conditions" => [
%{"column" => "price", "comparator" => "equals", "value" => "120", "type" => "number"}
]
}
}
电话中的:
conn = get conn, property_path(conn, :index, params)
但是在控制器中,当我检查收到的参数时,我得到:
%{
"filter" => %{
"conditions" => [
%{"column" => "price"},
%{"comparator" => "equals"},
%{"type" => "number"},
%{"value" => "120"}
],
"type" => "all"
}
}
数组中的单个项目已转换为数组,每个键/值都是一个地图本身。有没有办法获得与控制器参数相同的地图?