protected function hasMandatoryItem(array $definition)
    {
        foreach ($definition as $key => $node) {
            if (isset($node['required'])) {
                if ($node['required']) {
                    return true;
                }
            } else {
                if ($this->hasMandatoryItem($node)) {
                    return true;
                }
            }
        }

        return false;
    }