active_model_serializers

https://github.com/rails-api/active_model_serializers

Ruby

ActiveModel::Serializer implementation and Rails hooks

ActiveModelSerializers::Adapter::JsonApi::Error.attribute_error_objects

definition:
  JSON Object

properties:
  ☐ id      : String
  ☐ status  : String
  ☐ code    : String
  ☐ title   : String
  ☑ detail  : String
  ☐ links
  ☐ meta
  ☑ error_source

description:
  id     : A unique identifier for this particular occurrence of the problem.
  status : The HTTP status code applicable to this problem, expressed as a string value
  code   : An application-specific error code, expressed as a string value.
  title  : A short, human-readable summary of the problem. It **SHOULD NOT** change from
    occurrence to occurrence of the problem, except for purposes of localization.
  detail : A human-readable explanation specific to this occurrence of the problem.
structure:
  {
    title: 'SystemFailure',
    detail: 'something went terribly wrong',
    status: '500'
  }.merge!(errorSource)

Source | Google | Stack overflow

Edit

git clone [email protected]:rails-api/active_model_serializers.git

cd active_model_serializers

open lib/active_model_serializers/adapter/json_api/error.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-ActiveModelSerializers--Adapter--JsonApi--Error-attribute_error_objects-for-pr


# Commit to git

git add lib/active_model_serializers/adapter/json_api/error.rbgit commit -m "better docs for ActiveModelSerializers::Adapter::JsonApi::Error.attribute_error_objects"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-ActiveModelSerializers--Adapter--JsonApi--Error-attribute_error_objects-for-pr

hub pull-request


# Celebrate!