Exception: Apipie::ResponseDoesNotMatchSwaggerSchema

Inherits:
Error
  • Object
show all
Defined in:
lib/apipie/errors.rb

Instance Method Summary collapse

Constructor Details

#initialize(controller_name, method_name, response_code, error_messages, schema, returned_object) ⇒ ResponseDoesNotMatchSwaggerSchema

Returns a new instance of ResponseDoesNotMatchSwaggerSchema.



62
63
64
65
66
67
68
69
# File 'lib/apipie/errors.rb', line 62

def initialize(controller_name, method_name, response_code, error_messages, schema, returned_object)
  @controller_name = controller_name
  @method_name = method_name
  @response_code = response_code
  @error_messages = error_messages
  @schema = schema
  @returned_object = returned_object
end

Instance Method Details

#to_sObject



71
72
73
# File 'lib/apipie/errors.rb', line 71

def to_s
  "Response does not match swagger schema (#{@controller_name}##{@method_name} #{@response_code}): #{@error_messages}\nSchema: #{JSON(@schema)}\nReturned object: #{@returned_object}"
end