2

我使用 master 分支的wash_out。为什么我不能在不同的肥皂动作中使用相同的数据类型?

样本:

soap_action "get_groups",
:args   => {:page => :integer},
:return => {:data => [{:id => :integer, :name => :string}], :total => :integer}

soap_action "get_items",
:args   => {:page => :integer},
:return => {:data => [{:id => :integer, :name => :string}], :total => :integer}

我也尝试将其包装在 WashOut::Type 中,但没有帮助。

错误:

ActionView::Template::Error (Duplicate use of `data` type name. Consider using classified types.)
4

1 回答 1

2

我为自己找到了解决方案。WashOut 不能用于嵌套对象。

每个哈希都必须替换为 WashOut::Type。它应该如下所示: {:data => [SomeType], :total => :integer}

于 2014-03-24T09:24:41.927 回答