diff --git a/lib/api/errors/unwritable_property.rb b/lib/api/errors/unwritable_property.rb index 7b7b6c3055..409ea93c59 100644 --- a/lib/api/errors/unwritable_property.rb +++ b/lib/api/errors/unwritable_property.rb @@ -41,6 +41,8 @@ module API invalid_attributes.each do |attribute| @errors << UnwritableProperty.new(attribute) end + else + @details = { attribute: attributes[0] } end end end diff --git a/lib/api/v3/errors/error_representer.rb b/lib/api/v3/errors/error_representer.rb index ee3507ea78..b70825deac 100644 --- a/lib/api/v3/errors/error_representer.rb +++ b/lib/api/v3/errors/error_representer.rb @@ -42,6 +42,7 @@ module API property :_type, exec_context: :decorator property :error_identifier, exec_context: :decorator, render_nil: true property :message, getter: -> (*) { message }, render_nil: true + property :details, embedded: true collection :errors, embedded: true,