+### 🧩 Fix: Namespace Validator Does Not Set Default Value (Hacktoberfest)\n\n**🧩 Problem**\nIn `memori/utils/validators.py`, the namespace validator does not set a default value when the input is None, which can result in errors downstream.\n\n**📋 Steps to Fix**\n- Update `validate_namespace` to set a default value (e.g., "default") if the input is None or empty.\n- Add test cases for None/empty values.\n\n**✅ Acceptance Criteria**\n- Namespace validator provides a safe default when input is None/empty.\n- All uses of namespace in the codebase work without error.\n- Documentation and tests updated.\n\n**Refer to** `memori/utils/validators.py`\n\n**🤝 Hacktoberfest Details**\nThis issue is part of Hacktoberfest 2025 — valid pull requests will be merged or labeled hacktoberfest-accepted. Please review the [CONTRIBUTING.md](https://github.com/GibsonAI/memori/blob/main/CONTRIBUTING.md) for contribution guidelines. Follow our [Code of Conduct](https://github.com/GibsonAI/memori/blob/main/CODE_OF_CONDUCT.md) to maintain a positive and inclusive environment.\n⭐ Don't forget to star the repo on GitHub. It really helps our community grow.\n\n**Relevant code:**\n\nFile: [memori/utils/validators.py](https://github.com/GibsonAI/memori/blob/main/memori/utils/validators.py)\n```python\n@classmethod\ndef validate_namespace(cls, value: str, field_name: str = "namespace") -> str:\n """Validate namespace format"""\n if not isinstance(value, str):\n raise ValidationError(f"{field_name} must be a string")\n if not value:\n raise ValidationError(f"{field_name} cannot be empty")\n if len(value) > 64:\n raise ValidationError(f"{field_name} cannot exceed 64 characters")\n # Allow alphanumeric, underscore, hyphen\n if not re.match(r"^[a-zA-Z0-9_-]+$", value):\n raise ValidationError(\n f"{field_name} can only contain letters, numbers, underscores, and hyphens"\n )\n return value\n```
0 commit comments