Exception: JSONAPI::Exceptions::MissingKey

Inherits:
Error
  • Object
show all
Defined in:
lib/jsonapi/exceptions.rb

Instance Method Summary collapse

Instance Method Details

#errorsObject


352
353
354
355
356
357
358
359
# File 'lib/jsonapi/exceptions.rb', line 352

def errors
  [JSONAPI::Error.new(code: JSONAPI::KEY_ORDER_MISMATCH,
                      status: :bad_request,
                      title: I18n.translate('jsonapi-resources.exceptions.missing_key.title',
                                            default: 'A key is required'),
                      detail: I18n.translate('jsonapi-resources.exceptions.missing_key.detail',
                                             default: 'The resource object does not contain a key.'))]
end