report: align OpenAPI schemas with actual API responses and introduce DTO service contracts#342
Open
ol-zayatsm wants to merge 2 commits into
Open
report: align OpenAPI schemas with actual API responses and introduce DTO service contracts#342ol-zayatsm wants to merge 2 commits into
ol-zayatsm wants to merge 2 commits into
Conversation
Replace dict-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. Signed-off-by: Mikhail Zayats <mikhail.zayats@oktetlabs.ru>
b4b7391 to
725b522
Compare
ol-nata
suggested changes
Jul 7, 2026
| response=ReportConfigListResponseSerializer, | ||
| description='Configurations were successfully retrieved', | ||
| ), | ||
| }, |
Collaborator
There was a problem hiding this comment.
Missing 404 — self.get_object() can raise it if run_id doesn't exist.
| class ReportRetrieveResponseSerializer(serializers.Serializer): | ||
| warnings = serializers.ListField(child=serializers.CharField()) | ||
| config = ReportConfigSerializer() | ||
| content = serializers.ListField(child=serializers.DictField()) |
Collaborator
There was a problem hiding this comment.
content has a fully known 4-level structure (test → args-vals → measurement → record), each with fixed fields — DictField() loses all of it in the generated schema. Consider proper nested serializers for all four levels.
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>
725b522 to
35826d7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Summary
Update API v2 OpenAPI schema definitions for report endpoints and introduce
DTOs for report service responses to keep API documentation and service-layer
contracts aligned with current response payloads.
Changes
GET /report/{run_id}/configsendpoint.GET /report/{run_id}endpoint.configquery parameter for report generation.unprocessed iterations.
iterations.
200) and error (400,404) responses.