Skip to content

project: align OpenAPI schemas with actual API responses and introduce DTO service contracts - #342 - #354

Open
ol-zayatsm wants to merge 3 commits into
ts-factory:mainfrom
ol-zayatsm:project_swagger_upd
Open

project: align OpenAPI schemas with actual API responses and introduce DTO service contracts - #342#354
ol-zayatsm wants to merge 3 commits into
ts-factory:mainfrom
ol-zayatsm:project_swagger_upd

Conversation

@ol-zayatsm

Copy link
Copy Markdown
Contributor

Description

Summary

Update API v2 OpenAPI schema definitions for project endpoints and introduce
DTOs for project service responses to keep API documentation and service-layer
contracts aligned with the actual response payloads.

Changes

  • Add OpenAPI schema definitions for project endpoints.
  • Add request and response serializers for project API operations.
  • Document project list, retrieve, create, update, partial update, delete,
    and badge endpoints.
  • Document supported query parameters and error responses.
  • Add DTOs for project service responses.
  • Return DTOs from project service methods instead of dictionaries and
    model instances where applicable.
  • Serialize DTO-backed service responses in project endpoints.
  • Keep OpenAPI definitions aligned with the current project API behavior.

@ol-nata
ol-nata self-requested a review August 24, 2026 15:54

@ol-nata ol-nata left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. bublik/mcp/tools.py:172 (outside this diff): list_projects() now returns list[ProjectDTO], not list[dict] — annotation/docstring are stale.
  2. bublik/mcp/tools.py:182 (outside this diff): get_project() now returns ProjectDTO, not dict — annotation is stale.

tags=[PROJECT_TAG],
),
retrieve=extend_schema(
summary='Get project name',

@ol-nata ol-nata Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: summary says "Get project name", but the response returns the whole project (ID + name), not just the name field.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@ol-zayatsm
ol-zayatsm force-pushed the project_swagger_upd branch from f54bfd3 to 348363d Compare August 27, 2026 09:47
Replace dict-based and model-based service responses with typed DTOs to introduce
explicit and structured data contracts across service boundaries and
move serialization to API boundary to improve separation of
concerns between service layer and API layers. Fixed annotations for functions in
mcp tools file to match new updates.

Signed-off-by: Mikhail Zayats <mikhail.zayats@oktetlabs.ru>
Remove pagination from ProjectViewSet to align the generated list
documentation with the actual API behavior.

Signed-off-by: Mikhail Zayats <mikhail.zayats@oktetlabs.ru>
Ensure consistency between OpenAPI schemas and API responses by
introducing explicit request/response serializers and binding them via
drf-spectacular.

Signed-off-by: Mikhail Zayats <mikhail.zayats@oktetlabs.ru>
@ol-zayatsm
ol-zayatsm force-pushed the project_swagger_upd branch from 348363d to 6f3f005 Compare August 27, 2026 15:28
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.

2 participants