Description
BuffaLogs currently has REST APIs for managing users, alerts, logins, and other resources, but lacks comprehensive interactive API documentation. Adding OpenAPI/Swagger documentation would significantly improve the developer experience and make it easier for users to understand and interact with the API.
Current State
The docs/rest-apis.md file exists but contains minimal information ("API reference converted from the wiki"). The REST APIs are defined in buffalogs/buffalogs/urls.py but lack:
- Interactive documentation
- Request/response schemas
- Example payloads
- Authentication details
- Endpoint descriptions
Proposed Enhancement
Implement comprehensive OpenAPI/Swagger documentation using drf-spectacular or similar tools to:
- Auto-generate API documentation from Django REST Framework views and serializers
- Provide interactive UI (Swagger UI/ReDoc) for testing API endpoints
- Document all endpoints including:
- User management APIs (
/api/users/)
- Alert APIs (
/api/alerts/, /api/alerts/types/, /api/alerts/recent/)
- Login APIs (
/api/logins/)
- Authentication endpoints
- Include request/response examples with proper schemas
- Document authentication mechanisms and required permissions
Benefits
- Improved Developer Experience: Developers can understand and test APIs without reading source code
- Better Integration: External tools can easily integrate with BuffaLogs using the OpenAPI spec
- Reduced Support Burden: Self-documenting APIs reduce questions about endpoint usage
- Professional Standards: OpenAPI is an industry standard for REST API documentation
- GSoC Contribution: This would be a valuable contribution aligned with BuffaLogs' participation in GSoC 2025
Implementation Approach
- Add
drf-spectacular to project dependencies
- Configure OpenAPI schema generation in Django settings
- Add docstrings and schema definitions to existing API views/serializers
- Set up Swagger UI and ReDoc endpoints
- Update documentation to reference the new interactive API docs
- Add examples and descriptions for all endpoints
References
Additional Context
I would love to work on this enhancement as it aligns with my interest in improving open-source documentation and developer tools. I'm familiar with Django REST Framework and OpenAPI specifications.
Could you please assign this issue to me if it aligns with the project's roadmap? Happy to discuss the implementation approach or any modifications needed.
Description
BuffaLogs currently has REST APIs for managing users, alerts, logins, and other resources, but lacks comprehensive interactive API documentation. Adding OpenAPI/Swagger documentation would significantly improve the developer experience and make it easier for users to understand and interact with the API.
Current State
The
docs/rest-apis.mdfile exists but contains minimal information ("API reference converted from the wiki"). The REST APIs are defined inbuffalogs/buffalogs/urls.pybut lack:Proposed Enhancement
Implement comprehensive OpenAPI/Swagger documentation using
drf-spectacularor similar tools to:/api/users/)/api/alerts/,/api/alerts/types/,/api/alerts/recent/)/api/logins/)Benefits
Implementation Approach
drf-spectacularto project dependenciesReferences
Additional Context
I would love to work on this enhancement as it aligns with my interest in improving open-source documentation and developer tools. I'm familiar with Django REST Framework and OpenAPI specifications.
Could you please assign this issue to me if it aligns with the project's roadmap? Happy to discuss the implementation approach or any modifications needed.