fix(OpenAPI): Fix Stream response being treated as File response in OpenAPI schema#4371
Conversation
94f2615 to
85f4529
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4371 +/- ##
=======================================
Coverage 97.93% 97.93%
=======================================
Files 319 319
Lines 15569 15569
Branches 1721 1721
=======================================
Hits 15247 15247
Misses 184 184
Partials 138 138 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
85f4529 to
bcd7409
Compare
|
Documentation preview will be available shortly at https://litestar-org.github.io/litestar-docs-preview/4371 |
You can set the content media type manually: @get("/", content_media_type="application/octet-stream")
async def handler() -> Stream:
...This should have the same result. But now that I think about it, Feel free to open a new issue for this. |

Fix handler returning a
Streamfalsely indicating a file response in the OpenAPI schema:{ "description": "Stream Response", "headers": { "content-length": { "schema": { "type": "string" }, "description": "File size in bytes", "required": false, "deprecated": false }, "last-modified": { "schema": { "type": "string", "format": "date-time" }, "description": "Last modified data-time in RFC 2822 format", "required": false, "deprecated": false }, "etag": { "schema": { "type": "string" }, "description": "Entity tag", "required": false, "deprecated": false } }