ApeRAG
ApeRAG copied to clipboard
[Improvement] Generate and Use Python SDK for API Calls in E2E Tests
Description:
Currently, the E2E test code in test_collection.py and similar files uses an HTTP client to directly call API endpoints via URLs. For better maintainability, usability, and to provide a more realistic integration scenario, it would be beneficial to automatically generate a Python SDK from the OpenAPI specification and use this SDK for all API calls in the E2E tests.
Benefits:
- Ensures the SDK is always up-to-date with the API.
- Makes E2E tests more robust and easier to maintain.
- Provides a reference implementation for users who want to integrate with ApeRAG via the SDK, rather than raw HTTP calls.
- Reduces boilerplate code and potential errors in manual request construction.
Tasks:
- Set up automatic SDK generation from the OpenAPI spec (e.g., using openapi-generator).
- Refactor E2E tests to use the generated SDK instead of direct HTTP calls.
- Document the SDK usage for both internal tests and external users.
Additional Context:
- The OpenAPI spec is already maintained in the
aperag/apidirectory. - This change will also help external users integrate with ApeRAG more easily and consistently.