Apply BackendAIAPIMeta to REST API DTOs
- Dominant language
- Python
- Stars
- 670
- Forks
- 183
- Avg merge
- 17h 7m
- Merged PRs (30d)
- 358
Description
## Motivation
Apply `BackendAIAPIMeta` annotations to REST API request/response DTOs for consistent documentation and version tracking.
## Scope
Update files in:
- `src/ai/backend/manager/api/*/types.py`
- `src/ai/backend/manager/dto/*.py`
Apply metadata pattern:
```python
class CreateSessionRequest(BaseModel):
name: Annotated[
str,
Field(min_length=1, max_length=64),
BackendAIAPIMeta(
description="Session name.",
added_version="25.1.0",
example="my-session",
),
]
config: Annotated[
SessionConfig,
Field(),
BackendAIAPIMeta(
description="Session configuration.",
added_version="25.1.0",
composite=True,
),
]
```
## Acceptance Criteria
- All REST API DTOs annotated with BackendAIAPIMeta
- Primitive fields have explicit example values
- Composite fields use `composite=True` for auto-generation
- API documentation reflects metadata
## Dependencies
- BA-3784 (metadata classes implementation)
## References
- [BEP-1022: Pydantic Field Metadata Annotation](https://github.com/lablup/backend.ai/blob/main/proposals/BEP-1022-pydantic-field-annotations.md) Phase 3
JIRA Issue: BA-3787
Contributor guide
Assessment
This issue has not been assessed yet.