From 8b8da16ffe765a641ed8a84366b5cdc7175e54bb Mon Sep 17 00:00:00 2001 From: xn Date: Sun, 22 Oct 2017 13:36:18 -0500 Subject: [PATCH] add documentation --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index c3f8232..63a5da7 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,12 @@ require 'grape-active_model_serializers' class API < Grape::API format :json formatter :json, Grape::Formatter::ActiveModelSerializers + + # Serializes errors with ActiveModel::Serializer::ErrorSerializer if an ActiveModel. + # Serializer conforms to the adapter, ex: json, jsonapi. + # So an error formatted with a jsonapi formatter would render as per: + # http://jsonapi.org/format/#error-objects + error_formatter :json, Grape::Formatter::ActiveModelSerializers end ```