ActiveModel::Serializer makes it easy to output json-api compatible models, but if you try to respond with validation errors your 422 response will not be in json-api format, which will break compatible tools (e.g., Ember adapters)
You can monkey-patch rails so that respond_with
formats validation errors correctly (since ActiveModel::Error
already has enough information to be useful in json-api).
Just add an initializer that overrides ActionController::Responder#json_resource_errors
: