Method: JSONAPI::Resource#validation_error_metadata

Defined in:
lib/jsonapi/resource.rb

#validation_error_metadataObject

Add metadata to validation error objects.

Suppose ‘model_error_messages` returned the following error messages hash:

{password: ["too_short", "format"]}

Then to add data to the validation error ‘validation_error_metadata` could return:

{
  password: {
    "too_short": {"minimum_length" => 6},
    "format": {"requirement" => "must contain letters and numbers"}
  }
}

The specified metadata is then be merged into the validation error object.



146
147
148
# File 'lib/jsonapi/resource.rb', line 146

def 
  {}
end