Class: ArchivesSpaceSubTypeAttribute

Inherits:
JSON::Schema::TypeAttribute
  • Object
show all
Defined in:
common/archivesspace_json_schema.rb

Class Method Summary collapse

Class Method Details

.validate(current_schema, data, fragments, validator, options = {}) ⇒ Object



123
124
125
126
127
128
# File 'common/archivesspace_json_schema.rb', line 123

def self.validate(current_schema, data, fragments, validator, options = {})
  if data.is_a?(Hash) && !data.has_key?('ref')
    message = "ERROR: The property '#{build_fragment(fragments)}' did not contain a required property of 'ref'"
    validation_error(message, fragments, current_schema, self, options[:record_errors])
  end
end