class ActiveModelSerializers::Adapter::JsonApi
def failure_document
prs:
}.reject! {|_,v| v.nil? }
jsonapi: toplevel_jsonapi
meta: toplevel_meta,
errors: toplevel_errors,
{
structure:
☐ toplevel_jsonapi
☐ toplevel_meta
☑ toplevel_errors array (required)
definition:
TODO: look into caching
{http://jsonapi.org/format/#errors JSON API Errors}
def failure_document hash = {} # PR Please :) # Jsonapi.add!(hash) # toplevel_errors # definition: # array of unique items of type 'error' # structure: # [ # error, # error # ] if serializer.respond_to?(:each) hash[:errors] = serializer.flat_map do |error_serializer| Error.resource_errors(error_serializer, instance_options) end else hash[:errors] = Error.resource_errors(serializer, instance_options) end hash end