module JSI
module Schema::Validation::PropertyNames
def internal_validate_propertyNames(result_builder)
if keyword?('propertyNames')
if result_builder.instance.respond_to?(:to_hash)
results = {}
result_builder.instance.keys.each do |property_name|
results[property_name] = subschema(['propertyNames']).internal_validate_instance(
Ptr[],
property_name,
validate_only: result_builder.validate_only,
)
end
result_builder.validate(
results.values.all?(&:valid?),
'instance object property names are not all valid against `propertyNames` schema value',
keyword: 'propertyNames',
results: results.values,
)
end
end
end
end
end