Files
vectorize-io__hindsight/hindsight-docs/static/openapi.json
T
Nicolò Boschi 88456981f6 fix(api): declare binary download bodies so generated clients return bytes (#4315)
* fix(api): declare binary download bodies so generated clients return bytes (#4292)

GET attachments/{id} and files/download/{key} returned a raw Response with no
response_class, so FastAPI added application/json next to the declared binary
media type. The generated clients picked JSON and decoded the body as text,
corrupting the bytes (UnicodeDecodeError on a PNG's 0x89 magic byte).

Set response_class=Response and a string/binary schema on both routes, and
regenerate the spec and clients (Python now returns bytearray, TS Blob).

Tests: an api-slim spec guard that no 200 response mixes application/json with
a binary media type, and a live-server Python client test that retains an inline
PNG and fetches it back byte-identical.

* chore(docs-skill): regenerate the skill's OpenAPI copy for the binary download schema
2026-09-11 11:26:52 +02:00

531 KiB