Browse Source

Merge pull request #464 from provokateurin/feature/support-application-octet-stream

dynamite: Support application/octet-stream content type
pull/454/head
Kate 1 year ago committed by GitHub
parent
commit
1dd1a55f3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      packages/dynamite/dynamite/lib/src/openapi_builder.dart

4
packages/dynamite/dynamite/lib/src/openapi_builder.dart

@ -622,7 +622,9 @@ class OpenAPIBuilder implements Builder {
);
state.resolvedTypeCombinations.add(result);
if (mimeType == '*/*' || mimeType.startsWith('image/')) {
if (mimeType == '*/*' ||
mimeType == 'application/octet-stream' ||
mimeType.startsWith('image/')) {
dataType = 'Uint8List';
dataValue = 'response.bodyBytes';
} else if (mimeType.startsWith('text/')) {

Loading…
Cancel
Save