Skip to content

feat: typing binary/file responses as List<int> - #854

Draft
maximeroucher wants to merge 2 commits into
epam-cross-platform-lab:masterfrom
maximeroucher:upstream/fix/binary-responses
Draft

maximeroucher wants to merge 2 commits into
epam-cross-platform-lab:masterfrom
maximeroucher:upstream/fix/binary-responses

Conversation

@maximeroucher

@maximeroucher maximeroucher commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Type binary/file response bodies as Future<chopper.Response<List<int>>> instead of String/dynamic, so file/stream downloads are properly typed.

  • Detects binary responses across OpenAPI 2.0 (type: file), 3.0 (type: string, format: binary) and 3.1 (type: string, contentMediaType: ...).
  • Teaches the generated $JsonSerializableConverter to return response.bodyBytes for a List<int> result type instead of JSON-decoding.
  • Adds the contentMediaType field to SwaggerSchema (OpenAPI 3.1) which the binary detection relies on.
  • Adds tests covering the 3.0 and 3.1 shapes.

Relates to #116 (byte responses support).

@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.97%. Comparing base (a08d9a4) to head (2576ff6).
⚠️ Report is 9 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #854      +/-   ##
==========================================
+ Coverage   63.65%   63.97%   +0.32%     
==========================================
  Files           9        9              
  Lines        1183     1188       +5     
==========================================
+ Hits          753      760       +7     
+ Misses        430      428       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@maximeroucher
maximeroucher marked this pull request as draft August 3, 2026 16:22
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.

1 participant