Skip to content

[Improvement] Generate and Use Python SDK for API Calls in E2E Tests #1099

@iziang

Description

@iziang

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:

  1. Set up automatic SDK generation from the OpenAPI spec (e.g., using openapi-generator).
  2. Refactor E2E tests to use the generated SDK instead of direct HTTP calls.
  3. Document the SDK usage for both internal tests and external users.

Additional Context:

  • The OpenAPI spec is already maintained in the aperag/api directory.
  • This change will also help external users integrate with ApeRAG more easily and consistently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions