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.



280
281
282
# File 'lib/rswag/specs/request_factory.rb', line 280

def initialize(body_param)
  @body_param = body_param
end

Instance Attribute Details

#body_paramObject (readonly)

Returns the value of attribute body_param.



278
279
280
# File 'lib/rswag/specs/request_factory.rb', line 278

def body_param
  @body_param
end

Instance Method Details

#messageObject



284
285
286
287
288
289
290
291
292
293
# File 'lib/rswag/specs/request_factory.rb', line 284

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