class Dry::Schema::KeyValidator

def validate_path(key_paths, path)

Other tags:
    Api: - private
def validate_path(key_paths, path)
  if path[INDEX_REGEX]
    key = path.gsub(INDEX_REGEX, BRACKETS)
    if key_paths.none? { paths_match?(key, _1) }
      arr = path.gsub(INDEX_REGEX) { ".#{_1[1]}" }
      arr.split(DOT).map { DIGIT_REGEX.match?(_1) ? Integer(_1, 10) : _1.to_sym }
    end
  elsif key_paths.none? { paths_match?(path, _1) }
    path
  end
end