Skip to content

Commit 4ceda48

Browse files
committed
Ensure unique error objects
1 parent 077b64a commit 4ceda48

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/jsonapi/utils/response/formatters.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def jsonapi_format(records, options = {})
1616
def jsonapi_format_errors(data)
1717
data = JSONAPI::Utils::Exceptions::ActiveRecord.new(data) if data.is_a?(ActiveRecord::Base)
1818
errors = data.respond_to?(:errors) ? data.errors : data
19-
JSONAPI::Utils::Support::Error.sanitize(errors)
19+
JSONAPI::Utils::Support::Error.sanitize(errors).uniq
2020
end
2121

2222
protected

0 commit comments

Comments
 (0)