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.



213
214
215
# File 'lib/rswag/specs/request_factory.rb', line 213

def initialize(body_param)
  @body_param = body_param
end

Instance Attribute Details

#body_paramObject (readonly)

Returns the value of attribute body_param.



211
212
213
# File 'lib/rswag/specs/request_factory.rb', line 211

def body_param
  @body_param
end

Instance Method Details

#messageObject



217
218
219
220
221
222
223
224
225
226
# File 'lib/rswag/specs/request_factory.rb', line 217

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