Exception: JsonapiSwaggerHelpers::Errors::TypeNotFound

Inherits:
StandardError
  • Object
show all
Defined in:
lib/jsonapi_swagger_helpers/errors.rb

Instance Method Summary collapse

Constructor Details

#initialize(payload_name, attribute) ⇒ TypeNotFound

Returns a new instance of TypeNotFound.



4
5
6
7
# File 'lib/jsonapi_swagger_helpers/errors.rb', line 4

def initialize(payload_name, attribute)
  @payload_name = payload_name
  @attribute = attribute
end

Instance Method Details

#messageObject



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/jsonapi_swagger_helpers/errors.rb', line 9

def message
  <<-STR
Could not find type mapping for payload "#{@payload_name}", key "#{@attribute}".

To add a custom mapping:

JsonapiSwaggerHelpers.configure do |c|
  c.type_mapping[:string] << MyCustomType
end
  STR
end