Search code examples
ruby-on-railssoapwash-out

Why wash_out can't use identical data types in different soap actions?


I use wash_out from the master branch. Why I can't use identical data types in different soap actions?

Sample:

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}

Also I tried wrap it in WashOut::Type but it not help.

Error:

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

Solution

  • I found a solution for myself. WashOut can't work with nested objects.

    Every hash must be replaced with WashOut::Type. It should look like this: {:data => [SomeType], :total => :integer}