Skip to content

fix(api): preserve binary response bodies - #179

Open
Eotel wants to merge 2 commits into
nulab:mainfrom
Eotel:fix/api-binary-responses
Open

Eotel wants to merge 2 commits into
nulab:mainfrom
Eotel:fix/api-binary-responses

Conversation

@Eotel

@Eotel Eotel commented Oct 7, 2026

Copy link
Copy Markdown

Summary

bee api issues/PROJECT-1/attachments/123 > image.png now writes the attachment bytes unchanged. Previously, an HTTP 200 image response failed with a JSON parsing error and left the output empty.

  1. Read the authenticated response before choosing its format. Stream non-JSON bodies to stdout; preserve JSON formatting and field selection for JSON media types.
  2. Discard the body for --silent, omit output for empty responses, and report a clear error when --json is requested for a non-JSON response.
  3. Add a download example to command help and regression coverage through the real SDK with fixture responses.

Closes #178

Test plan

  1. The PNG regression failed before the fix with SyntaxError: ... is not valid JSON. After the fix, vp test passes 804 tests across 118 files, including all 37 API-command tests.
  2. vp check, vp lint --max-warnings 0, and vp run --filter @nulab/bee generate:skill:check pass. vp run -r build builds the CLI and all 105 docs pages, with valid internal links.
  3. The built CLI passes local HTTP-fixture checks on Node.js 20.20.2 and 24.21.0: the 68-byte PNG matches exactly; JSON field selection, binary --silent, the non-JSON --json error, and HTTP 204/403 handling work.

Live Backlog attachment retrieval was not tested because no target issue was supplied. Network verification used a local fixture server and dummy API-key authentication.

@Eotel
Eotel requested a review from lollipop-onl as a code owner October 7, 2026 06:57

This branch has not been deployed

No deployments
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.

bee api fails to download binary attachment responses

1 participant