From 1c5b356da37443a5391b13aba492a3539038b822 Mon Sep 17 00:00:00 2001 From: DHARANI_KUMAR Date: Sat, 17 Aug 2019 13:19:35 +0530 Subject: [PATCH] additionalProperties_for_array --- lib/json-schema/attributes/additionalproperties.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)