Sha256: a921ac5fbde983dad0e831337fd68fdfe65c8896698c606ece76f759a2f066bf
Contents?: true
Size: 1.16 KB
Versions: 20
Compression:
Stored size: 1.16 KB
Contents
# frozen_string_literal: true module JSI module Schema::Validation::PropertyNames # @private def internal_validate_propertyNames(result_builder) if keyword?('propertyNames') # The value of "propertyNames" MUST be a valid JSON Schema. # # If the instance is an object, this keyword validates if every property name in the instance # validates against the provided schema. Note the property name that the schema is testing will # always be a string. 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
Version data entries
20 entries across 20 versions & 2 rubygems