def iter_dict(self) -> Iterator[Result]:
        """Iterate over a :class:`dict` based ``validator`` to validate the corresponding entries in ``data``.

        :yields: objects with the error message related to the failure, if any check fails.
        """
        # One key in `validator` attribute (`key` variable) can be mapped to one or more keys in `data` attribute (`d`
        # variable), depending on the `key` type.
        data = cast(Dict[Any, Any], self.data)
        validators = cast(Dict[Any, Any], self.validator)
        for key in validators.keys():
            if isinstance(key, AtMostOne) and len(list(self._data_key(key))) > 1:
                yield Result(False, f"Multiple of {key.args} provided")
                continue
            for d in self._data_key(key):
                if d not in data and not isinstance(key, Optional):
                    yield Result(False, "is not defined.", path=d)
                elif d not in data and isinstance(key, Optional) and key.default is None:
                    continue
                else:
                    if d not in data and isinstance(key, Optional):
                        data[d] = key.default
                    validator = validators[key]
                    if isinstance(key, (Or, AtMostOne)) and isinstance(validators[key], Case):
                        validator = validators[key]._schema[d]
                    # In this loop we may be calling a new `Schema` either over an intermediate node in the tree, or
                    # over a leaf node. In the latter case the recursive calls in the given path will finish.
                    for v in Schema(validator).validate(data[d]):
                        yield Result(v.status, v.error,
                                     path=(d + ("." + v.path if v.path else "")), level=v.level, data=v.data)
Iterate over a :class:`dict` based ``validator`` to validate the corresponding entries in ``data``.

        :yields: objects with the error message related to the failure, if any check fails.
        
patroni/validator.py