ActionController :: RoutingError(#<Swagger :: Blocks :: Nodes :: OperationNode:

时间:2019-06-11 15:13:07

标签: ruby swagger polymorphic-associations

在我的Branch模型中,它有一个银行详细信息。银行模型由许多模型共享。因此,我使用了多态关联。我想在Swagger UI中显示它。我不知道那是怎么回事?

如果我取消注释嵌套属性,则正确显示...

  ​        parameter do          
            key :name, 'bank_attributes[recipient]'     
            key :in, :formData
            key :description, 'Recipient'
            key :required, true
            key :type, :string 
          end
          parameter do
            key :name, 'bank_attributes[bank_name]'
            key :in, :formData
            key :description, 'bank name'
            key :required, true
            key :type, :string 
          end
          parameter do
            key :name, 'bank_attributes[account_no]'
            key :in, :formData
            key :description, 'bank account no'
            key :required, true
            key :type, :string 
          end       

我的日志文件:

ActionController::RoutingError (undefined method `​parameter' for #<Swagger::Blocks::Nodes::OperationNode:0x00007fe0d02569b8>
Did you mean?  parameter):

app/controllers/swagger/controllers/branches_controller.rb:238:in `block (2 levels) in <class:BranchesController>'

Routes

Rails.application.routes.draw do

  resources :apidocs, only: [:index]
  post 'authenticate', to: 'authentication#authenticate'

  resources :branches 
  resources :banks
end

0 个答案:

没有答案