【发布时间】:2016-06-26 21:40:52
【问题描述】:
我正在为这样的葡萄路线定义参数
params do
requires :array, type: Array do
requires :foo, type: String
requires :bar, type: String
end
end
此端点的数据为{"array": [{"foo": "123", "bar": "456"}]}。
我怎样才能摆脱额外的
"array"?数据应如下所示[{"foo": "123", "bar": "456"}]
我无法在 params 上定义类型 Array。
【问题讨论】:
-
我认为大多数 DSL 会因为漏洞而跳过这一点(如此处所述:stackoverflow.com/q/395592/3109182)
-
好的,有道理!谢谢!