diff --git a/lib/json-schema/attributes/additionalproperties.rb b/lib/json-schema/attributes/additionalproperties.rb index 82793beb..573b994f 100644 --- a/lib/json-schema/attributes/additionalproperties.rb +++ b/lib/json-schema/attributes/additionalproperties.rb @@ -6,7 +6,7 @@ class Schema class AdditionalPropertiesAttribute < Attribute def self.validate(current_schema, data, fragments, processor, validator, options = {}) schema = current_schema.schema - return unless data.is_a?(Hash) && (schema['type'].nil? || schema['type'] == 'object') + return unless data.is_a?(Hash) && (schema['type'].nil? || schema['type'] == 'object' || (schema['type'].is_a?(Array) && schema['type'].include?('object'))) extra_properties = remove_valid_properties(data.keys, current_schema, validator)