fork of hey-api/openapi-ts because I need some additional things
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #853 from hey-api/fix/multipart-form-data-no-header

fix: remove Content-Type header with multipart/form-data content type

authored by

Lubos and committed by
GitHub
e344ee0a 572fce1e

+42 -1
+5
.changeset/rare-insects-return.md
··· 1 + --- 2 + '@hey-api/openapi-ts': patch 3 + --- 4 + 5 + fix: remove Content-Type header with multipart/form-data content type
+7 -1
packages/openapi-ts/src/generate/services.ts
··· 255 255 { 256 256 spread: 'formDataBodySerializer', 257 257 }, 258 - // no need for Content-Type header, browser will set it automatically 258 + { 259 + key: 'headers', 260 + value: { 261 + // no need for Content-Type header, browser will set it automatically 262 + 'Content-Type': null, 263 + }, 264 + }, 259 265 ]; 260 266 onClientImport?.('formDataBodySerializer'); 261 267 }
+6
packages/openapi-ts/test/__snapshots__/test/generated/v3_hey-api_client-axios/services.gen.ts.snap
··· 101 101 export const postApiVbyApiVersionFormData = (options?: Options<PostApiVbyApiVersionFormDataData>) => { return (options?.client ?? client).post<void>({ 102 102 ...options, 103 103 ...formDataBodySerializer, 104 + headers: { 105 + 'Content-Type': null 106 + }, 104 107 url: '/api/v{api-version}/formData/' 105 108 }); }; 106 109 ··· 206 209 export const multipartRequest = (options?: Options<MultipartRequestData>) => { return (options?.client ?? client).post<void>({ 207 210 ...options, 208 211 ...formDataBodySerializer, 212 + headers: { 213 + 'Content-Type': null 214 + }, 209 215 url: '/api/v{api-version}/multipart' 210 216 }); }; 211 217
+6
packages/openapi-ts/test/__snapshots__/test/generated/v3_hey-api_client-axios_bundle/services.gen.ts.snap
··· 101 101 export const postApiVbyApiVersionFormData = (options?: Options<PostApiVbyApiVersionFormDataData>) => { return (options?.client ?? client).post<void>({ 102 102 ...options, 103 103 ...formDataBodySerializer, 104 + headers: { 105 + 'Content-Type': null 106 + }, 104 107 url: '/api/v{api-version}/formData/' 105 108 }); }; 106 109 ··· 206 209 export const multipartRequest = (options?: Options<MultipartRequestData>) => { return (options?.client ?? client).post<void>({ 207 210 ...options, 208 211 ...formDataBodySerializer, 212 + headers: { 213 + 'Content-Type': null 214 + }, 209 215 url: '/api/v{api-version}/multipart' 210 216 }); }; 211 217
+6
packages/openapi-ts/test/__snapshots__/test/generated/v3_hey-api_client-fetch/services.gen.ts.snap
··· 101 101 export const postApiVbyApiVersionFormData = (options?: Options<PostApiVbyApiVersionFormDataData>) => { return (options?.client ?? client).post<void>({ 102 102 ...options, 103 103 ...formDataBodySerializer, 104 + headers: { 105 + 'Content-Type': null 106 + }, 104 107 url: '/api/v{api-version}/formData/' 105 108 }); }; 106 109 ··· 206 209 export const multipartRequest = (options?: Options<MultipartRequestData>) => { return (options?.client ?? client).post<void>({ 207 210 ...options, 208 211 ...formDataBodySerializer, 212 + headers: { 213 + 'Content-Type': null 214 + }, 209 215 url: '/api/v{api-version}/multipart' 210 216 }); }; 211 217
+6
packages/openapi-ts/test/__snapshots__/test/generated/v3_hey-api_client-fetch_bundle/services.gen.ts.snap
··· 101 101 export const postApiVbyApiVersionFormData = (options?: Options<PostApiVbyApiVersionFormDataData>) => { return (options?.client ?? client).post<void>({ 102 102 ...options, 103 103 ...formDataBodySerializer, 104 + headers: { 105 + 'Content-Type': null 106 + }, 104 107 url: '/api/v{api-version}/formData/' 105 108 }); }; 106 109 ··· 206 209 export const multipartRequest = (options?: Options<MultipartRequestData>) => { return (options?.client ?? client).post<void>({ 207 210 ...options, 208 211 ...formDataBodySerializer, 212 + headers: { 213 + 'Content-Type': null 214 + }, 209 215 url: '/api/v{api-version}/multipart' 210 216 }); }; 211 217
+6
packages/openapi-ts/test/__snapshots__/test/generated/v3_hey-api_client-fetch_plugin_tanstack-react-query/services.gen.ts.snap
··· 101 101 export const postApiVbyApiVersionFormData = (options?: Options<PostApiVbyApiVersionFormDataData>) => { return (options?.client ?? client).post<void>({ 102 102 ...options, 103 103 ...formDataBodySerializer, 104 + headers: { 105 + 'Content-Type': null 106 + }, 104 107 url: '/api/v{api-version}/formData/' 105 108 }); }; 106 109 ··· 206 209 export const multipartRequest = (options?: Options<MultipartRequestData>) => { return (options?.client ?? client).post<void>({ 207 210 ...options, 208 211 ...formDataBodySerializer, 212 + headers: { 213 + 'Content-Type': null 214 + }, 209 215 url: '/api/v{api-version}/multipart' 210 216 }); }; 211 217