active_model_serializers

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

Ruby

ActiveModel::Serializer implementation and Rails hooks

ActiveModelSerializers::Adapter::JsonApi::Error.error_source

errorSource
description:
  oneOf
    ☑ pointer   : String
    ☑ parameter : String

description:
  pointer: A JSON Pointer RFC6901 to the associated entity in the request document e.g. "/data"
  for a primary data object, or "/data/attributes/title" for a specific attribute.
  https://tools.ietf.org/html/rfc6901

  parameter: A string indicating which query parameter caused the error
structure:
  if is_attribute?
    {
      pointer: '/data/attributes/red-button'
    }
  else
    {
      parameter: 'pres'
    }
  end

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-error_source-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.error_source"


# 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-error_source-for-pr

hub pull-request


# Celebrate!