fix(api): response_model=None for 5 streaming/binary endpoints — #5317 follow-up#5845
Merged
mrveiss merged 1 commit intoDev_new_guifrom Apr 25, 2026
Merged
fix(api): response_model=None for 5 streaming/binary endpoints — #5317 follow-up#5845mrveiss merged 1 commit intoDev_new_guifrom
mrveiss merged 1 commit intoDev_new_guifrom
Conversation
…y endpoints (#5317 follow-up) Five endpoints introduced in the #5317 100% coverage sweep incorrectly received response_model=DataResponse but actually return non-JSON responses: - api/a2a.py: stream_task_events() — SSE StreamingResponse - api/conversation_files.py: download_conversation_file() — FileResponse - api/files.py: download_file() — FileResponse - api/process_management.py: get_process_logs() — PlainTextResponse - api/prometheus_endpoint.py: metrics_endpoint() — Prometheus text format response_model=None is correct for these: FastAPI skips response validation and omits the model from the OpenAPI schema, which prevents misleading documentation claiming these return DataResponse JSON. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
Fixes a bug introduced by #5834 (#5317 sweep): 5 endpoints received
response_model=DataResponsebut actually return non-JSON responses and must useresponse_model=None.api/a2a.pystream_task_events()StreamingResponse(SSE)api/conversation_files.pydownload_conversation_file()FileResponseapi/files.pydownload_file()FileResponseapi/process_management.pyget_process_logs()PlainTextResponseapi/prometheus_endpoint.pymetrics_endpoint()CONTENT_TYPE_LATEST)response_model=DataResponseon a streaming/binary endpoint would produce incorrect OpenAPI documentation claiming a JSON body is returned.Discovery process
Caught by post-implementation gap review: AST-scanned all endpoints annotated with
DataResponseand cross-referenced function bodies forStreamingResponse,FileResponse, andPlainTextResponsereturns.🤖 Generated with Claude Code