Skip to content

Docs: Missing API Endpoint Docstrings and OpenAPI Integration#2

Open
maptoan wants to merge 1 commit intomasterfrom
contribai/docs/missing-api-endpoint-docstrings-and-open
Open

Docs: Missing API Endpoint Docstrings and OpenAPI Integration#2
maptoan wants to merge 1 commit intomasterfrom
contribai/docs/missing-api-endpoint-docstrings-and-open

Conversation

@maptoan
Copy link
Copy Markdown
Owner

@maptoan maptoan commented Mar 29, 2026

Problem

The FastAPI server exposes several endpoints (/config, /ws/progress) but lacks docstrings for these functions and the ConnectionManager class. FastAPI leverages docstrings and type hints to automatically generate OpenAPI (Swagger UI) documentation. Without these, the auto-generated documentation will be sparse, and developers consuming the API will have to infer functionality from the code, leading to potential misunderstandings and increased integration effort.

Severity: high
File: src/api/server.py

Solution

Add comprehensive docstrings to all public API endpoints and the ConnectionManager class and its methods. Use type hints consistently to enhance the auto-generated OpenAPI documentation.

Changes

  • src/api/server.py (modified)

Testing

  • Existing tests pass
  • Manual review completed
  • No new warnings/errors introduced

The FastAPI server exposes several endpoints (`/config`, `/ws/progress`) but lacks docstrings for these functions and the `ConnectionManager` class. FastAPI leverages docstrings and type hints to automatically generate OpenAPI (Swagger UI) documentation. Without these, the auto-generated documentation will be sparse, and developers consuming the API will have to infer functionality from the code, leading to potential misunderstandings and increased integration effort.

Affected files: server.py

Signed-off-by: toanmap <174589430+maptoan@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant