Exception: Rswag::Specs::MissingParameterError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/rswag/specs/request_factory.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(body_param) ⇒ MissingParameterError

Returns a new instance of MissingParameterError.



290
291
292
# File 'lib/rswag/specs/request_factory.rb', line 290

def initialize(body_param)
  @body_param = body_param
end

Instance Attribute Details

#body_paramObject (readonly)

Returns the value of attribute body_param.



288
289
290
# File 'lib/rswag/specs/request_factory.rb', line 288

def body_param
  @body_param
end

Instance Method Details

#messageObject



294
295
296
297
298
299
300
301
302
303
# File 'lib/rswag/specs/request_factory.rb', line 294

def message
  <<~MSG
    Missing parameter '#{body_param}'

    Please check your spec. It looks like you defined a body parameter,
    but did not declare usage via let. Try adding:

        let(:#{body_param}) {}
  MSG
end