Skip to content

Commit 0286452

Browse files
authored
fix: add zip to the binary application types list (orval-labs#3257)
1 parent c8f9a58 commit 0286452

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

packages/core/src/getters/res-req-types.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ describe('isBinaryContentType', () => {
7878
it('should return true for binary content types', () => {
7979
expect(isBinaryContentType('application/octet-stream')).toBe(true);
8080
expect(isBinaryContentType('application/pdf')).toBe(true);
81+
expect(isBinaryContentType('application/zip')).toBe(true);
8182
expect(isBinaryContentType('image/png')).toBe(true);
8283
expect(isBinaryContentType('image/jpeg')).toBe(true);
8384
expect(isBinaryContentType('audio/mp3')).toBe(true);

packages/core/src/getters/response.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,16 @@ describe('getResponse', () => {
130130
});
131131

132132
describe('isBlob detection', () => {
133-
it('should set isBlob to true for application/octet-stream response', () => {
133+
it.each([
134+
['application/octet-stream'],
135+
['application/pdf'],
136+
['application/zip'],
137+
])('should set isBlob to true for %s response', (binaryApplicationType) => {
134138
const responses: OpenApiResponsesObject = {
135139
'200': {
136140
description: 'Binary file',
137141
content: {
138-
'application/octet-stream': {
142+
[binaryApplicationType]: {
139143
schema: { type: 'string', format: 'binary' },
140144
},
141145
},

packages/core/src/utils/content-type.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import type { OpenApiSchemaObject } from '../types';
44
const binaryApplicationTypes = new Set([
55
'application/octet-stream',
66
'application/pdf',
7+
'application/zip',
78
]);
89

910
/**

0 commit comments

Comments
 (0)